enju_resource_merge 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,13 @@ class SeriesStatementMergeList < ActiveRecord::Base
|
|
10
10
|
|
11
11
|
def merge_series_statements(selected_series_statement)
|
12
12
|
series_statements.each do |series_statement|
|
13
|
-
|
13
|
+
if series_statement == selected_series_statement
|
14
|
+
series_statement.root_manifestation.update_attributes!({
|
15
|
+
:original_title => selected_series_statement.original_title,
|
16
|
+
:title_transcription => selected_series_statement.title_transcription,
|
17
|
+
:title_alternative => selected_series_statement.title_alternative
|
18
|
+
}) if series_statement.root_manifestation
|
19
|
+
else
|
14
20
|
series_statement.manifestations.each do |manifestation|
|
15
21
|
manifestation.series_statement = selected_series_statement
|
16
22
|
manifestation.save!
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -5,8 +5,11 @@ describe SeriesStatementMergeList do
|
|
5
5
|
|
6
6
|
it "should merge series_statment" do
|
7
7
|
series_statement_merge_list = series_statement_merge_lists(:series_statement_merge_list_00001)
|
8
|
-
|
9
|
-
|
8
|
+
series_statement = SeriesStatement.find(2)
|
9
|
+
series_statement_merge_list.merge_series_statements(series_statement).should be_true
|
10
|
+
Manifestation.find(2).series_statement.id.should eq 2
|
11
|
+
Manifestation.find(3).series_statement.id.should eq 2
|
12
|
+
Manifestation.find(3).series_statement.original_title.should eq series_statement.original_title
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_resource_merge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|