11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/models/series_statement_merge_list.rb', line 11
def merge_series_statements(selected_series_statement)
series_statements.each do |series_statement|
if series_statement == selected_series_statement
series_statement.root_manifestation.update_attributes!({
:original_title => selected_series_statement.original_title,
:title_transcription => selected_series_statement.title_transcription,
:title_alternative => selected_series_statement.title_alternative
}) if series_statement.root_manifestation
else
series_statement.manifestations.each do |manifestation|
manifestation.series_statement = selected_series_statement
manifestation.save!
end
series_statement.destroy
end
end
end
|