Sha256: fb6635b2f2783a7e0b0aafc06a494309e475929b374a8b491914c92fd2d219fa

Contents?: true

Size: 448 Bytes

Versions: 10

Compression:

Stored size: 448 Bytes

Contents

class VendorObserver < ActiveRecord::Observer
  observe :vendor

  #
  # On create, new VendorDetail joins are created for each existing member
  #
  def after_create(record)
    VendorMember.add_vendor_proxy(record.vendor_proxies)
  end

  #
  # On updates, all members are touched, ensuring that widget JSON requests 
  # for the members are pulling the most recent information
  #
  def after_update(record)
    VendorMember.touch_all
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
e9_vendors-0.0.10 app/observers/vendor_observer.rb
e9_vendors-0.0.9 app/observers/vendor_observer.rb
e9_vendors-0.0.8 app/observers/vendor_observer.rb
e9_vendors-0.0.7 app/observers/vendor_observer.rb
e9_vendors-0.0.6 app/observers/vendor_observer.rb
e9_vendors-0.0.5 app/observers/vendor_observer.rb
e9_vendors-0.0.4 app/observers/vendor_observer.rb
e9_vendors-0.0.3 app/observers/vendor_observer.rb
e9_vendors-0.0.2 app/observers/vendor_observer.rb
e9_vendors-0.0.1 app/observers/vendor_observer.rb