Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class Thingy
  2. is_eventable
  3. end
  4.  
  5. @thingy = Thingy.new
  6. @thingy.event = 'created'
  7. @thingy.actioner = @user
  8. @thingy.save!
  9. # Event created with polymorphic link to @thingy and @user
  10.  
  11. # some time later
  12. @thingy.update_attributes! params[:thingy].merge(:event => 'updated', :actioner => @user)
  13. # Event created with polymorphic link to @thingy and @user
  14.  
  15. # even more time later
  16. @thingy.wotsit = 'parp'
  17. @thingy.no_logging = true
  18. @thingy.save!
  19. # No event created
Add Comment
Please, Sign In to add comment