Sha256: 17b752857629689bb723c146390740c9d21ead1abf5641c2ad425d85b8860730

Contents?: true

Size: 822 Bytes

Versions: 9

Compression:

Stored size: 822 Bytes

Contents

class SeriesHasManifestation < ActiveRecord::Base
  belongs_to :series_statement
  belongs_to :manifestation

  validates_associated :series_statement, :manifestation
  validates_presence_of :series_statement_id, :manifestation_id
  validates_uniqueness_of :manifestation_id, :scope => :series_statement_id

  acts_as_list :scope => :series_statement_id

  after_create :reindex
  after_destroy :reindex

  def self.per_page
    10
  end

  def reindex
    series_statement.try(:index)
    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
#  updated_at          :datetime
#

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
enju_resource_merge-0.0.10 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.9 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.8 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.7 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.6 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.5 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.4 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.3 spec/dummy/app/models/series_has_manifestation.rb
enju_resource_merge-0.0.2 spec/dummy/app/models/series_has_manifestation.rb