Sha256: 70c6295f6aec31a0502d8987e4d9ec92b3e60f7af759097169abd698cd05b3c9

Contents?: true

Size: 477 Bytes

Versions: 33

Compression:

Stored size: 477 Bytes

Contents

module CabooseStore
  class Vendor < ActiveRecord::Base
    self.table_name = 'store_vendors'
    
    has_many :products
    attr_accessible :id, :name, :status, :sort_order
    after_save :clear_filters
    
    def self.active
      where(:status => 'Active')
    end
    
    def update_products
      self.products.each { |product| product.update_attribute(:vendor_status, self.status) }
    end
    
    def clear_filters
      SearchFilter.delete_all
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
caboose-store-0.0.43 app/models/caboose_store/vendor.rb
caboose-store-0.0.42 app/models/caboose_store/vendor.rb
caboose-store-0.0.41 app/models/caboose_store/vendor.rb
caboose-store-0.0.40 app/models/caboose_store/vendor.rb
caboose-store-0.0.39 app/models/caboose_store/vendor.rb
caboose-store-0.0.38 app/models/caboose_store/vendor.rb
caboose-store-0.0.37 app/models/caboose_store/vendor.rb
caboose-store-0.0.36 app/models/caboose_store/vendor.rb
caboose-store-0.0.35 app/models/caboose_store/vendor.rb
caboose-store-0.0.34 app/models/caboose_store/vendor.rb
caboose-store-0.0.33 app/models/caboose_store/vendor.rb
caboose-store-0.0.32 app/models/caboose_store/vendor.rb
caboose-store-0.0.31 app/models/caboose_store/vendor.rb
caboose-store-0.0.30 app/models/caboose_store/vendor.rb
caboose-store-0.0.29 app/models/caboose_store/vendor.rb
caboose-store-0.0.28 app/models/caboose_store/vendor.rb
caboose-store-0.0.27 app/models/caboose_store/vendor.rb
caboose-store-0.0.26 app/models/caboose_store/vendor.rb
caboose-store-0.0.25 app/models/caboose_store/vendor.rb
caboose-store-0.0.24 app/models/caboose_store/vendor.rb