active-fedora 9.0.5 → 9.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +16 -0
- data/lib/active_fedora/fedora_attributes.rb +5 -1
- data/lib/active_fedora/version.rb +1 -1
- data/spec/unit/base_spec.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbfeceebf66b94fa9e04ccb8527c9795167a4e73
|
4
|
+
data.tar.gz: 7438bf293a82b052a103ccea3febb14929e9e3c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa70a485f881672113c3004de9da43d15bb6008e8a95bf85ce22d097260b51169240490b2f2d369eeeb93fa429df116a5f0790b5707bb8ba5cc18684c098e0ef
|
7
|
+
data.tar.gz: cd423d69239dc6c2dfce41c5ad4c69570a71099d82a543122247efc421d59f1637dba4b5ff43319ccd8702f9f97b30ede3891c9c78db2acae083b693da798dfd
|
data/History.txt
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
v9.0.6
|
2
|
+
2015-03-26: Setting type should not wipe out properties. Fixes #737 [Justin Coyne]
|
3
|
+
|
4
|
+
v9.0.5
|
5
|
+
2015-03-25: Properties named *_id should not break the change set [Chris Colvard]
|
6
|
+
|
7
|
+
2015-03-24: Add rdf:type assertions to ActiveFedora::Base [Justin Coyne]
|
8
|
+
|
9
|
+
2015-03-24: Add documentation that differentiates attach_file from add_file [Justin Coyne]
|
10
|
+
|
11
|
+
2015-03-24: Remove #default_attributes. Fixes #732 [Chris Colvard]
|
12
|
+
|
13
|
+
2015-03-18: Make sure datastreams get configured on load as well as new/create [Michael B. Klein]
|
14
|
+
|
15
|
+
2015-03-17: Allow a has_many association to specify an explicit foreign key via the :as option [Michael B. Klein]
|
16
|
+
|
1
17
|
v9.0.4
|
2
18
|
2015-03-10: Refactor the AF::Base initializer [Justin Coyne]
|
3
19
|
|
@@ -65,9 +65,12 @@ module ActiveFedora
|
|
65
65
|
module ClassMethods
|
66
66
|
# We make a unique class, because properties belong to a class.
|
67
67
|
# This keeps properties from different objects separate.
|
68
|
+
# Since the copy of properties can only happen once, we don't want to invoke it
|
69
|
+
# until all properties have been defined.
|
68
70
|
def resource_class
|
69
71
|
@generated_resource_class ||= begin
|
70
72
|
klass = self.const_set(:GeneratedResourceSchema, Class.new(ActiveTriples::Resource))
|
73
|
+
klass.configure type: @type if @type
|
71
74
|
klass.properties.merge(self.properties).each do |property, config|
|
72
75
|
klass.property(config.term,
|
73
76
|
predicate: config.predicate,
|
@@ -77,8 +80,9 @@ module ActiveFedora
|
|
77
80
|
end
|
78
81
|
end
|
79
82
|
|
83
|
+
# Set the rdf type for this class
|
80
84
|
def type(uri)
|
81
|
-
|
85
|
+
@type = uri
|
82
86
|
end
|
83
87
|
end
|
84
88
|
end
|
data/spec/unit/base_spec.rb
CHANGED
@@ -32,15 +32,23 @@ describe ActiveFedora::Base do
|
|
32
32
|
before do
|
33
33
|
class FooHistory < ActiveFedora::Base
|
34
34
|
type ::RDF::URI.new('http://example.com/foo')
|
35
|
+
property :title, predicate: ::RDF::DC.title
|
35
36
|
end
|
36
37
|
end
|
37
38
|
after do
|
38
39
|
Object.send(:remove_const, :FooHistory)
|
39
40
|
end
|
40
41
|
|
41
|
-
subject { FooHistory.new
|
42
|
+
subject { FooHistory.new.type }
|
42
43
|
|
43
44
|
it { is_expected.to eq [RDF::URI('http://example.com/foo')] }
|
45
|
+
|
46
|
+
context "when type is called before propertes" do
|
47
|
+
subject { FooHistory.resource_class.reflect_on_property(:title) }
|
48
|
+
it "should not wipe out the properties" do
|
49
|
+
expect(subject).to be_kind_of ActiveTriples::NodeConfig
|
50
|
+
end
|
51
|
+
end
|
44
52
|
end
|
45
53
|
|
46
54
|
describe 'descendants' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.0.
|
4
|
+
version: 9.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-03-
|
13
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|