Class: Flag
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Flag
- Defined in:
- app/models/flag.rb
Instance Method Summary (collapse)
-
- (Object) callback_flaggable
Pings the 'after_flagged' callback in the content model, if it exists.
- - (Object) moderate(params)
- - (Object) set_owner_id
Instance Method Details
- (Object) callback_flaggable
Pings the 'after_flagged' callback in the content model, if it exists.
28 29 30 |
# File 'app/models/flag.rb', line 28 def callback_flaggable flaggable.callback :after_flagged end |
- (Object) moderate(params)
45 46 47 48 49 50 51 52 53 |
# File 'app/models/flag.rb', line 45 def moderate(params) if params == "approve" update_attributes(:moderation_required => false, :approved => true) elsif params == "disapprove" update_attributes(:moderation_required => false, :approved => false) else #error end end |
- (Object) set_owner_id
33 34 35 |
# File 'app/models/flag.rb', line 33 def set_owner_id self.flaggable_user_id = flaggable.user_id end |