Guest User

Untitled

a guest
Jun 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. class MailInbox < ActiveRecord::Base
  2. belongs_to :inbox
  3. delegate :name, :name=, :description, :description=, :to => :inbox
  4. after_save :save_inbox
  5. after_destroy :destroy_inbox
  6.  
  7.  
  8. protected
  9. def after_initialize
  10. build_inbox
  11. end
  12.  
  13. def save_inbox
  14. inbox.save
  15. end
  16.  
  17. def destroy_inbox
  18. inbox.destroy
  19. end
  20. end
Add Comment
Please, Sign In to add comment