Class: VendorObserver

Inherits:
ActiveRecord::Observer
  • Object
show all
Defined in:
app/observers/vendor_observer.rb

Instance Method Summary collapse

Instance Method Details

#after_create(record) ⇒ Object

On create, new VendorDetail joins are created for each existing member



7
8
9
# File 'app/observers/vendor_observer.rb', line 7

def after_create(record)
  VendorMember.add_vendor_proxy(record.vendor_proxies)
end

#after_update(record) ⇒ Object

On updates, all members are touched, ensuring that widget JSON requests for the members are pulling the most recent information



15
16
17
# File 'app/observers/vendor_observer.rb', line 15

def after_update(record)
  VendorMember.touch_all
end