Module: Touch::ClassMethods

Defined in:
lib/touch.rb

Instance Method Summary collapse

Instance Method Details

#touch(association_name, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/touch.rb', line 8

def touch(association_name, options = {})
  options = options.dup
  options.reverse_merge!(on: %w[create update destroy])
  options[:on].map!(&:to_s)

  options[:on].each do |event|
    add_collection_touch_for(association_name, event)
  end
end