Sha256: ab8d69caac311f3799f01acd9e6f62dfd4051ed8525277c2c3aee63ba0008839
Contents?: true
Size: 846 Bytes
Versions: 5
Compression:
Stored size: 846 Bytes
Contents
class Order < ActiveRecord::Base 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