active-fedora 6.4.1 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/active_fedora/callbacks.rb +1 -1
- data/lib/active_fedora/persistence.rb +10 -8
- data/lib/active_fedora/version.rb +1 -1
- data/spec/unit/base_spec.rb +13 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3121b41531277d5c0351a7e657d063fb628ba733
|
4
|
+
data.tar.gz: 48e5886abd01bc9afb4329004c8293401a89708d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3757c8465f920bf90ce99c8319d58137c335929c8d5b115b157491e2f86a5df1a7686675f2e5c516ab434e28e55fa309afd0b0f4db02f58be10baf01684769e7
|
7
|
+
data.tar.gz: 6e3b6a10c6bc56d075df2779e2cc18b3574dd254e18df6fda760c8478177cf191281e6dad210f74cc4cb52dcc522756da66a43cff215d6d1eb265965bb41c14b
|
@@ -11,7 +11,7 @@ module ActiveFedora
|
|
11
11
|
result = create
|
12
12
|
update_index if create_needs_index?
|
13
13
|
else
|
14
|
-
result =
|
14
|
+
result = update_record
|
15
15
|
update_index if update_needs_index?
|
16
16
|
end
|
17
17
|
return result
|
@@ -27,11 +27,14 @@ module ActiveFedora
|
|
27
27
|
add_relationship(:has_model, self.class.to_class_uri)
|
28
28
|
end
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
# Pushes the object and all of its new or dirty datastreams into Fedora
|
31
|
+
def update(attributes)
|
32
|
+
self.attributes=attributes
|
32
33
|
save
|
33
34
|
end
|
34
35
|
|
36
|
+
alias update_attributes update
|
37
|
+
|
35
38
|
# Refreshes the object's info from Fedora
|
36
39
|
# Note: Currently just registers any new datastreams that have appeared in fedora
|
37
40
|
def refresh
|
@@ -138,16 +141,15 @@ module ActiveFedora
|
|
138
141
|
persist
|
139
142
|
end
|
140
143
|
|
144
|
+
def update_record
|
145
|
+
persist
|
146
|
+
end
|
147
|
+
|
141
148
|
# replace the unsaved digital object with a saved digital object
|
142
149
|
def assign_pid
|
143
150
|
@inner_object = @inner_object.save
|
144
151
|
end
|
145
152
|
|
146
|
-
# Pushes the object and all of its new or dirty datastreams into Fedora
|
147
|
-
def update
|
148
|
-
persist
|
149
|
-
end
|
150
|
-
|
151
153
|
def persist
|
152
154
|
result = @inner_object.save
|
153
155
|
|
data/spec/unit/base_spec.rb
CHANGED
@@ -339,7 +339,7 @@ describe ActiveFedora::Base do
|
|
339
339
|
|
340
340
|
it "should update an existing record" do
|
341
341
|
@test_object.stub(:new_record? => false)
|
342
|
-
@test_object.should_receive(:
|
342
|
+
@test_object.should_receive(:update_record)
|
343
343
|
@test_object.should_receive(:update_index)
|
344
344
|
@test_object.save
|
345
345
|
end
|
@@ -519,7 +519,6 @@ pending "This is broken, and deprecated. I don't want to fix it - jcoyne"
|
|
519
519
|
end
|
520
520
|
|
521
521
|
describe "update_attributes" do
|
522
|
-
|
523
522
|
it "should set the attributes and save" do
|
524
523
|
m = FooHistory.new
|
525
524
|
att= {"fubar"=> '1234', "baz" =>'stuff'}
|
@@ -530,6 +529,18 @@ pending "This is broken, and deprecated. I don't want to fix it - jcoyne"
|
|
530
529
|
m.update_attributes(att)
|
531
530
|
end
|
532
531
|
end
|
532
|
+
|
533
|
+
describe "update" do
|
534
|
+
it "should set the attributes and save" do
|
535
|
+
m = FooHistory.new
|
536
|
+
att= {"fubar"=> '1234', "baz" =>'stuff'}
|
537
|
+
|
538
|
+
m.should_receive(:fubar=).with('1234')
|
539
|
+
m.should_receive(:baz=).with('stuff')
|
540
|
+
m.should_receive(:save)
|
541
|
+
m.update(att)
|
542
|
+
end
|
543
|
+
end
|
533
544
|
|
534
545
|
describe "update_indexed_attributes" do
|
535
546
|
before do
|