active_fedora-registered_attributes 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75df440b7dde330695f9cf1398b481e261b066f7
|
4
|
+
data.tar.gz: 041e953410c3ab4231ce3a29cddda5669ea3cfbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c789ab0d0f9cbfd99a7560ccb355e0053794681fe60d7f404cad88355116ac510863d5dd017a45c43b6f3305c9907b18fde798713e30c6525506d028c8f64f38
|
7
|
+
data.tar.gz: e729fdc5b4bb38949da5c723138d31516a2877973805713723a207257397ac1ebd5a635328aa9ec4b6e70d88284701c5624a3e7a48167f2513f318125c2bd770
|
@@ -44,26 +44,20 @@ module ActiveFedora
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
|
48
|
-
# Applies the attribute defaults
|
49
|
-
#
|
50
|
-
# Applies all the default values to any attributes not yet set, avoiding
|
51
|
-
# any attribute setter logic, such as dirty tracking.
|
52
|
-
#
|
53
|
-
# @param [Hash{String => Object}, #each] defaults The defaults to apply
|
54
|
-
def apply_defaults(defaults=attribute_defaults)
|
55
|
-
defaults.each do |name, value|
|
56
|
-
unless value.nil?
|
57
|
-
send("#{name}=", value) unless send("#{name}").present?
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
47
|
# Applies attribute default values
|
63
48
|
def initialize(*)
|
64
49
|
super
|
65
50
|
apply_defaults
|
66
51
|
end
|
67
52
|
|
53
|
+
protected
|
54
|
+
def apply_defaults(defaults=attribute_defaults)
|
55
|
+
defaults.each do |name, value|
|
56
|
+
if !value.nil? && !persisted?
|
57
|
+
send("#{name}=", value) # unless send("#{name}").present?
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
68
61
|
end
|
62
|
+
|
69
63
|
end
|
@@ -147,7 +147,7 @@ describe ActiveFedora::RegisteredAttributes::Attribute do
|
|
147
147
|
|
148
148
|
describe 'without datastream and skipping accessor' do
|
149
149
|
let(:options) { {datastream: nil, skip_accessor: true} }
|
150
|
-
it 'does not yield accession
|
150
|
+
it 'does not yield accession options_for_input' do
|
151
151
|
@yielded = false
|
152
152
|
puts subject.send(:options)
|
153
153
|
subject.with_accession_options {|name,opts|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_fedora-registered_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-fedora
|