Sha256: 104a8e58106380d1d3e9415d0d4ec1d2f8e0ae6177bf06e150aec417332f3807
Contents?: true
Size: 1.01 KB
Versions: 24
Compression:
Stored size: 1.01 KB
Contents
class SeriesHasManifestation < ActiveRecord::Base attr_accessible :series_statement_id, :manifestation_id belongs_to :series_statement belongs_to :manifestation accepts_nested_attributes_for :series_statement validates_associated :series_statement, :manifestation validates_presence_of :series_statement_id validates_presence_of :manifestation_id, :on => :update validates_uniqueness_of :manifestation_id, :scope => :series_statement_id after_save :reindex after_destroy :reindex acts_as_list :scope => :series_statement_id paginates_per 10 def reindex series_statement.reload; series_statement.try(:index) manifestation.reload; manifestation.try(:index) end end # == Schema Information # # Table name: series_has_manifestations # # id :integer not null, primary key # series_statement_id :integer # manifestation_id :integer # position :integer # created_at :datetime not null # updated_at :datetime not null #
Version data entries
24 entries across 24 versions & 1 rubygems