embark-journey 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/journey/resource/attribute_loading.rb +5 -4
- data/lib/journey/version.rb +1 -1
- data/spec/models/journey/resource_spec.rb +16 -0
- 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: 8ff4c2db85aaf7d550ca956451148647cf657051
|
4
|
+
data.tar.gz: 9d11c870f8dd88da7507b7da115ae6f8a98171ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7125ff7e6868d2eff5f93ef135115d2b0b5db53ea476dcb603b24642a706774a10ad208511d0d79b480519975146a849abeaf073a85d89c7a629213a7ac04717
|
7
|
+
data.tar.gz: 70904a5745c17fcffe74d9520607830885faf526685142ff30b2016237df22a38c571628321c7053d5dd1b23f3555feed8b9732a1d2871fedeb1d73c9f983975
|
@@ -7,10 +7,11 @@ module Journey::Resource::AttributeLoading
|
|
7
7
|
# uses defined setters in place of attributes[key] where possible,
|
8
8
|
# for the purpose of enums
|
9
9
|
def load(attributes, remove_root = false, persisted = false)
|
10
|
-
super(attributes, remove_root, persisted).tap do
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
super(attributes, remove_root, persisted).tap do |x|
|
11
|
+
# send each ENUM
|
12
|
+
# self.attributes.each do |key, value|
|
13
|
+
# send("#{key}=", value) if respond_to?("#{key}=")
|
14
|
+
# end
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/lib/journey/version.rb
CHANGED
@@ -45,6 +45,13 @@ describe Journey::Resource do
|
|
45
45
|
r.reload
|
46
46
|
expect(r.status).to be_nil
|
47
47
|
end
|
48
|
+
|
49
|
+
it 'remembers enum values' do
|
50
|
+
r = klass.create(name: 'X', status: 'Inactive')
|
51
|
+
expect(r).to be_persisted
|
52
|
+
r = klass.find(r.id)
|
53
|
+
expect(r.status).to eq 'Inactive'
|
54
|
+
end
|
48
55
|
end
|
49
56
|
end
|
50
57
|
|
@@ -142,7 +149,16 @@ describe Journey::Resource do
|
|
142
149
|
expect(job.reported_fault).to eq fault
|
143
150
|
end
|
144
151
|
|
152
|
+
it 'updates an embedded association id correctly' do
|
153
|
+
asset = Asset.create name: 'asset'
|
154
|
+
job = Job.create name: 'job', asset_id: asset.id
|
155
|
+
job = Job.find(job.id)
|
156
|
+
|
157
|
+
new_asset = Asset.create name: 'asset'
|
158
|
+
job.update_attributes(asset_id: new_asset.id)
|
145
159
|
|
160
|
+
expect(Job.find(job.id).asset_id).to eq new_asset.id
|
161
|
+
end
|
146
162
|
end
|
147
163
|
|
148
164
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embark-journey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Davey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|