embark-journey 0.1.5 → 0.1.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 +4 -4
- data/lib/active_resource/associations.rb +2 -2
- data/lib/journey/resource/attribute_loading.rb +10 -1
- data/lib/journey/version.rb +1 -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: 177f36337f55709ec264098ecc3f810226a77c30
|
4
|
+
data.tar.gz: f33b30380f80fb669218b4bc72be8c1f1562325d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 925c574614b4e687671dd66fc8fd752e64a01fd34060ffc236d62d6ba8420bd5ee14e6e27214d0b4ee6cb6aac38a500d3dedfa86aecb5bc9c73e0f6cd1df2846
|
7
|
+
data.tar.gz: 75eec0780c5007d96a2ebb4e13c6d62ca752bd65a05094a71dcb5f49e2ce3e92babb15d32ccc310ef0708be1058a012f09d182cae61532f1bb98ab52f88bfd2e
|
@@ -126,8 +126,8 @@ module ActiveResource::Associations
|
|
126
126
|
end
|
127
127
|
|
128
128
|
define_method(method_name) do
|
129
|
-
if
|
130
|
-
|
129
|
+
if ivar = instance_variable_get(ivar_name)
|
130
|
+
ivar
|
131
131
|
elsif attributes.include?(method_name)
|
132
132
|
attributes[method_name]
|
133
133
|
elsif association_id = send(finder_key)
|
@@ -7,10 +7,19 @@ module Journey::Resource::AttributeLoading
|
|
7
7
|
def load(attributes, remove_root = false, persisted = false)
|
8
8
|
# 'data' is a reserved key in ActiveResource,
|
9
9
|
# but Journey uses it for the Oplog
|
10
|
-
|
10
|
+
if content = attributes.delete('data')
|
11
|
+
attributes['content'] = content
|
12
|
+
end
|
11
13
|
|
12
14
|
super(attributes, remove_root, persisted).tap do
|
13
15
|
|
16
|
+
# set the cached value of any updated associations (e.g. parent_id)
|
17
|
+
# to nil so that they can be re-fetched
|
18
|
+
attributes.keys.map(&:to_s).select{ |key| key =~ /_id$/ }.each do |association_key|
|
19
|
+
association = association_key.gsub /_id$/, ''
|
20
|
+
instance_variable_set("@#{association}", nil)
|
21
|
+
end
|
22
|
+
|
14
23
|
# allow enum_sets to be loaded by key (rather than index)
|
15
24
|
# by auto-converting them on initialization
|
16
25
|
if enum_sets = self.class.instance_variable_get(:@enum_sets)
|
data/lib/journey/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Davey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|