app/models/series_statement.rb in enju_biblio-0.1.0.pre55 vs app/models/series_statement.rb in enju_biblio-0.1.0.pre56
- old
+ new
@@ -4,12 +4,12 @@
:series_statement_identifier, :note,
:root_manifestation_id, :url,
:title_subseries_transcription, :creator_string, :volume_number_string
attr_accessible :series_master
- belongs_to :manifestation
- belongs_to :root_manifestation, :foreign_key => :root_manifestation_id, :class_name => 'Manifestation'
+ belongs_to :manifestation, touch: true
+ belongs_to :root_manifestation, foreign_key: :root_manifestation_id, class_name: 'Manifestation', touch: true
validates_presence_of :original_title
before_save :create_root_series_statement
acts_as_list
searchable do
@@ -17,11 +17,11 @@
titles
end
text :numbering, :title_subseries, :numbering_subseries
integer :manifestation_id
integer :position
- integer :series_statement_merge_list_ids, :multiple => true if defined?(EnjuResourceMerge)
+ integer :series_statement_merge_list_ids, multiple: true if defined?(EnjuResourceMerge)
end
attr_accessor :selected
normalize_attributes :original_title
@@ -35,15 +35,17 @@
end
def create_root_series_statement
if series_master? and root_manifestation.nil?
self.root_manifestation = manifestation
+ else
+ self.root_manifestation = nil
end
end
if defined?(EnjuResourceMerge)
- has_many :series_statement_merges, :dependent => :destroy
- has_many :series_statement_merge_lists, :through => :series_statement_merges
+ has_many :series_statement_merges, dependent: :destroy
+ has_many :series_statement_merge_lists, through: :series_statement_merges
end
end
# == Schema Information
#