Sha256: c5f2e5f363b6c1859184fba475d4c69d294d46693ba9e7dcd9127a05582b94af
Contents?: true
Size: 633 Bytes
Versions: 22
Compression:
Stored size: 633 Bytes
Contents
class Own < ApplicationRecord 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
22 entries across 22 versions & 1 rubygems