Module: Gluttonberg::CanFlag::CanBeFlaggedMixin
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/gluttonberg/can_flag.rb
Instance Method Summary collapse
-
#flagged=(by_who) ⇒ Object
Flag content with a mass-updater; sets the flagging user.
- #flagged? ⇒ Boolean
- #inappropriate? ⇒ Boolean
Instance Method Details
#flagged=(by_who) ⇒ Object
Flag content with a mass-updater; sets the flagging user. article.update_attributes { ‘flagged’ => current_user.id }
61 62 63 |
# File 'lib/gluttonberg/can_flag.rb', line 61 def flagged=(by_who) flags.build :user_id => by_who end |
#flagged? ⇒ Boolean
51 52 53 |
# File 'lib/gluttonberg/can_flag.rb', line 51 def flagged? flags.size > 0 end |
#inappropriate? ⇒ Boolean
55 56 57 |
# File 'lib/gluttonberg/can_flag.rb', line 55 def inappropriate? flags.find_all{|f| f.approved == true }.size > 0 end |