Sha256: 58a69104df4fb7d04971a69f25a686991dac23548838d71e12a289015b613e5d
Contents?: true
Size: 771 Bytes
Versions: 5
Compression:
Stored size: 771 Bytes
Contents
class WorkHasSubject < ActiveRecord::Base attr_accessible :subject_id, :work_id 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 self.per_page 10 end 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 # created_at :datetime # updated_at :datetime # position :integer #
Version data entries
5 entries across 5 versions & 1 rubygems