Sha256: cb862b7d1fc0c9c79dbe2d9800912b1ba00bb8d7b13cd256f0f418dfd97e1d4c
Contents?: true
Size: 634 Bytes
Versions: 29
Compression:
Stored size: 634 Bytes
Contents
class Own < ActiveRecord::Base belongs_to :agent belongs_to :item validates_associated :agent, :item validates_presence_of :agent, :item validates_uniqueness_of :item_id, scope: :agent_id after_save :reindex after_destroy :reindex acts_as_list scope: :item attr_accessor :item_identifier def reindex agent.try(:index) item.try(:index) end end # == Schema Information # # Table name: owns # # id :integer not null, primary key # agent_id :integer not null # item_id :integer not null # position :integer # created_at :datetime # updated_at :datetime #
Version data entries
29 entries across 28 versions & 2 rubygems