Module: ApplicationUserstampConcern::ClassMethods

Defined in:
app/models/concerns/application_userstamp_concern.rb

Instance Method Summary collapse

Instance Method Details

#add_userstamp_associations(options) ⇒ Object


16
17
18
19
# File 'app/models/concerns/application_userstamp_concern.rb', line 16

def add_userstamp_associations(options)
  options.reverse_merge!(inverse_of: false)
  super(options)
end

#inherited(klass) ⇒ Object

Bring forward the userstamp association definitions TODO: Remove after lowjoel/activerecord-userstamp#27 is closed


8
9
10
11
12
13
14
# File 'app/models/concerns/application_userstamp_concern.rb', line 8

def inherited(klass)
  super

  klass.class_eval do
    add_userstamp_associations({})
  end
end