Class: Flag
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Flag
- Defined in:
- app/models/flag.rb
Instance Method Summary collapse
-
#callback_flaggable ⇒ Object
Pings the ‘after_flagged’ callback in the content model, if it exists.
- #moderate(params) ⇒ Object
- #set_owner_id ⇒ Object
Instance Method Details
#callback_flaggable ⇒ Object
Pings the ‘after_flagged’ callback in the content model, if it exists.
29 30 31 |
# File 'app/models/flag.rb', line 29 def callback_flaggable flaggable.callback :after_flagged end |
#moderate(params) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'app/models/flag.rb', line 46 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 |
#set_owner_id ⇒ Object
34 35 36 |
# File 'app/models/flag.rb', line 34 def set_owner_id self.flaggable_user_id = flaggable.user_id end |