Sha256: 81a1e654cd89681d805c780b29d3dcd9509b7aa7ae2765539f059bd8ce74fa8b

Contents?: true

Size: 840 Bytes

Versions: 17

Compression:

Stored size: 840 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
  after_save :reload
  after_save :reindex
  after_destroy :reindex

  acts_as_list :scope => :series_statement_id

  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

17 entries across 17 versions & 1 rubygems

Version Path
enju_bookmark-0.0.19 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.18 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.17 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.16 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.15 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.14 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.13 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.12 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.11 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.10 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.9 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.8 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.7 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.6 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.5 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.4 spec/dummy/app/models/series_has_manifestation.rb
enju_bookmark-0.0.3 spec/dummy/app/models/series_has_manifestation.rb