Sha256: e722452f0aa7fbc0ab36d62cf9d0af8e6526265a1b8b656a99df52b271148905
Contents?: true
Size: 865 Bytes
Versions: 191
Compression:
Stored size: 865 Bytes
Contents
module Caboose class Vendor < ActiveRecord::Base self.table_name = 'store_vendors' belongs_to :site has_many :products has_attached_file :image, :path => ':path_prefixvendors/:id_:style.:extension', :default_url => 'http://placehold.it/300x300', :styles => { :tiny => '150x200>', :thumb => '300x400>', :large => '600x800>' } do_not_validate_attachment_file_type :image attr_accessible :id, :site_id, :alternate_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
191 entries across 191 versions & 1 rubygems