Sha256: 8228bc8bbee4a023a0983e0979bd347a10c2bd98e1cce662265f18a634309924
Contents?: true
Size: 820 Bytes
Versions: 26
Compression:
Stored size: 820 Bytes
Contents
class SeriesStatementRelationship < ActiveRecord::Base attr_accessible :child_id, :parent_id belongs_to :parent, :foreign_key => 'parent_id', :class_name => 'SeriesStatement' belongs_to :child, :foreign_key => 'child_id', :class_name => 'SeriesStatement' after_save :reindex after_destroy :reindex validates_presence_of :parent_id, :child_id validates_uniqueness_of :child_id, :scope => :parent_id acts_as_list :scope => :parent_id def reindex parent.try(:index) child.try(:index) Sunspot.commit end end # == Schema Information # # Table name: series_statement_relationships # # id :integer not null, primary key # parent_id :integer # child_id :integer # position :integer # created_at :datetime not null # updated_at :datetime not null #
Version data entries
26 entries across 26 versions & 1 rubygems