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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a1796f2ca4e14c106158d316ed0fbe3af97d618
4
- data.tar.gz: 5fd016e3273256d82bd48bbd476b192addf31c7c
3
+ metadata.gz: 8ff4c2db85aaf7d550ca956451148647cf657051
4
+ data.tar.gz: 9d11c870f8dd88da7507b7da115ae6f8a98171ea
5
5
  SHA512:
6
- metadata.gz: 8ee7e6f3e659bf9b3749a5608de9c0c6fa79dab09981bf5b7838acfb74458f511a8719fe56c4b5162d3092809942668c69a6c56b518d65f8fde967f1baf0a32b
7
- data.tar.gz: 7a6f543b57bc740f351cfc4e51b85d0c5fcea5d88962ea670645ab1cb2004f123279d2339ad56385f699a1aacff2896591ae64874a043e01623f76076e26ba9e
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
- self.attributes.each do |key, value|
12
- send("#{key}=", value) if respond_to?("#{key}=")
13
- end
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
@@ -2,7 +2,7 @@ module Journey
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 11
5
+ TINY = 12
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
8
8
  end
@@ -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.11
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-05-19 00:00:00.000000000 Z
11
+ date: 2014-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_attr