Sha256: 0e215be8f7be6fa3d40d715e6f54a4da085c2b7a9d780b429293e14ce3cbc8b5
Contents?: true
Size: 913 Bytes
Versions: 5
Compression:
Stored size: 913 Bytes
Contents
class Order < ActiveRecord::Base attr_accessible :order_list_id, :purchase_request_id belongs_to :order_list, :validate => true belongs_to :purchase_request, :validate => true validates_associated :order_list, :purchase_request validates_presence_of :order_list, :purchase_request validates_uniqueness_of :purchase_request_id, :scope => :order_list_id after_save :reindex after_destroy :reindex acts_as_list :scope => :order_list paginates_per 10 def reindex purchase_request.try(:index) end end # == Schema Information # # Table name: orders # # id :integer not null, primary key # order_list_id :integer not null # purchase_request_id :integer not null # position :integer # state :string(255) # created_at :datetime not null # updated_at :datetime not null #
Version data entries
5 entries across 5 versions & 1 rubygems