Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Thingy
- is_eventable
- end
- @thingy = Thingy.new
- @thingy.event = 'created'
- @thingy.actioner = @user
- @thingy.save!
- # Event created with polymorphic link to @thingy and @user
- # some time later
- @thingy.update_attributes! params[:thingy].merge(:event => 'updated', :actioner => @user)
- # Event created with polymorphic link to @thingy and @user
- # even more time later
- @thingy.wotsit = 'parp'
- @thingy.no_logging = true
- @thingy.save!
- # No event created
Add Comment
Please, Sign In to add comment