active-fedora 9.0.5 → 9.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 436ba8923ff37c5dd40860044ff513a17c7ad780
4
- data.tar.gz: e9b48072342526acefc2ab0210a9da725057b118
3
+ metadata.gz: cbfeceebf66b94fa9e04ccb8527c9795167a4e73
4
+ data.tar.gz: 7438bf293a82b052a103ccea3febb14929e9e3c2
5
5
  SHA512:
6
- metadata.gz: b58f0179c05783ff6897723088979c1605d5d4a1901b082e2893c6f1ef7b7023c701bd6a91fa345c9ce19833a0ce37a7040b250282ca07a2e8cd6e8f79fcdf8b
7
- data.tar.gz: 47851b957993caf1586409266240480f8763b65643bcf41cc9269aaf717ffe010df2cd3ede6bf940aac648179bf20aa992a9920daf8266338e39a2578fb08d66
6
+ metadata.gz: aa70a485f881672113c3004de9da43d15bb6008e8a95bf85ce22d097260b51169240490b2f2d369eeeb93fa429df116a5f0790b5707bb8ba5cc18684c098e0ef
7
+ data.tar.gz: cd423d69239dc6c2dfce41c5ad4c69570a71099d82a543122247efc421d59f1637dba4b5ff43319ccd8702f9f97b30ede3891c9c78db2acae083b693da798dfd
@@ -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
- resource_class.configure type: uri
85
+ @type = uri
82
86
  end
83
87
  end
84
88
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "9.0.5"
2
+ VERSION = "9.0.6"
3
3
  end
@@ -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().type }
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.5
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-26 00:00:00.000000000 Z
13
+ date: 2015-03-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr