Module: Gluttonberg::CanFlag::CanFlagInstanceMethods
- Defined in:
- lib/gluttonberg/can_flag.rb
Instance Method Summary collapse
Instance Method Details
#flagged?(content) ⇒ Boolean
60 61 62 63 64 |
# File 'lib/gluttonberg/can_flag.rb', line 60 def flagged?(content) logger.warn "Looking for flags with #{content.inspect} #{content.class.name}" ::Flag.find(:first, :conditions => { :flaggable_type => content.class.name, :flaggable_id => content[:id] }) end |
#flagged_by?(content, user) ⇒ Boolean
66 67 68 69 |
# File 'lib/gluttonberg/can_flag.rb', line 66 def flagged_by?(content, user) ::Flag.find(:first, :conditions => { :flaggable_type => content.class.name, :flaggable_id => content[:id], :flaggable_user_id => user.id }) end |