Method: Cms::Behaviors::Userstamping::MacroMethods#is_userstamped
- Defined in:
- lib/cms/behaviors/userstamping.rb
#is_userstamped(_options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cms/behaviors/userstamping.rb', line 13 def is_userstamped(={}) @is_userstamped = true extend ClassMethods include InstanceMethods belongs_to :created_by, class_name: Cms.user_class_name belongs_to :updated_by, class_name: Cms.user_class_name before_save :set_userstamps scope :created_by, lambda { |user| { conditions: { created_by: user } } } scope :updated_by, lambda { |user| { conditions: { updated_by: user } } } end |