Sha256: 129d9f5535c9b9e00b215c6ce91d27eeb90b463cad97860f6889b18194df65fe
Contents?: true
Size: 749 Bytes
Versions: 9
Compression:
Stored size: 749 Bytes
Contents
class WorkHasSubject < ActiveRecord::Base attr_accessible :subject_id, :work_id, :position belongs_to :subject belongs_to :work, :class_name => 'Manifestation' validates_presence_of :work, :subject #, :subject_type validates_associated :work, :subject validates_uniqueness_of :subject_id, :scope => :work_id after_save :reindex after_destroy :reindex acts_as_list :scope => :work_id def reindex work.try(:index) subject.try(:index) end end # == Schema Information # # Table name: work_has_subjects # # id :integer not null, primary key # subject_id :integer # subject_type :string(255) # work_id :integer # position :integer # created_at :datetime # updated_at :datetime #
Version data entries
9 entries across 9 versions & 1 rubygems