Module: Caboose::Can::Flag::InstanceMethods

Defined in:
lib/can_flag.rb

Overview

This module contains instance methods

Instance Method Summary collapse

Instance Method Details

#flagged=(by_who) ⇒ Object

Flag content with a mass-updater; sets the flagging user. article.update_attributes { ‘flagged’ => current_user.id }



94
95
96
# File 'lib/can_flag.rb', line 94

def flagged=(by_who)
  flags.build :user_id => by_who
end

#flagged?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/can_flag.rb', line 88

def flagged?
  flags.size > 0
end