encore 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/encore/persister/links_parser.rb +1 -1
- data/lib/encore/serializer/main_resource_links_manager.rb +1 -1
- data/lib/encore/version.rb +1 -1
- data/spec/encore/serializer/links_resources/belongs_to_spec.rb +1 -1
- data/spec/encore/serializer/links_resources/can_access_spec.rb +6 -4
- 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: 21758c507cf16a19783160bbe8def677e038051d
|
4
|
+
data.tar.gz: 9ea74add7b1302b2ea1494cbd34230d14ac99e6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64ec538a05a209fce5b03f3bc082a14a7561bb948fc4330196a25022587a594138b1d7dcd61614578d537fec7d5755ef55238231aa114366fa957f97d0b2f3d0
|
7
|
+
data.tar.gz: d528113ef87bad63d5b0a848e16e6925d38e0ad642f4c57ea1a89ffc5e43b8e2c1e9326f0cf7493697cff562eb390ea55e26d34cfc46855d2e1b36f0a181618e
|
data/.travis.yml
CHANGED
@@ -8,7 +8,7 @@ module Encore
|
|
8
8
|
|
9
9
|
links.each do |link, value|
|
10
10
|
reflections = @model.try(:_reflections) || @model.reflections
|
11
|
-
reflection = reflections[link.to_sym]
|
11
|
+
reflection = reflections[link.to_s] || reflections[link.to_sym]
|
12
12
|
key = fetch_key(reflection)
|
13
13
|
value = fetch_value(value, reflection)
|
14
14
|
|
@@ -19,7 +19,7 @@ module Encore
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def self.association_collection(item, inclusion, reflections)
|
22
|
-
reflection = reflections[inclusion]
|
22
|
+
reflection = reflections[inclusion.to_s] || reflections[inclusion.to_sym]
|
23
23
|
class_name = fetch_class_name(item, reflection)
|
24
24
|
|
25
25
|
collection = begin
|
data/lib/encore/version.rb
CHANGED
@@ -46,7 +46,6 @@ describe Encore::Serializer do
|
|
46
46
|
spawn_serializer('ProjectSerializer') do
|
47
47
|
attributes :name
|
48
48
|
end
|
49
|
-
|
50
49
|
end
|
51
50
|
let(:create_records!) do
|
52
51
|
User.create name: 'Allan', project_id: 1
|
@@ -74,12 +73,13 @@ describe Encore::Serializer do
|
|
74
73
|
spawn_serializer('ProjectSerializer') do
|
75
74
|
attributes :name
|
76
75
|
end
|
77
|
-
|
78
76
|
end
|
77
|
+
|
79
78
|
let(:create_records!) do
|
80
79
|
User.create name: 'Allan', project_id: 1
|
81
80
|
User.create name: 'Doe', project_id: 2
|
82
81
|
end
|
82
|
+
|
83
83
|
let(:include) { '' }
|
84
84
|
|
85
85
|
it { expect(serialized[:users][0][:links][:project].present?).to eq(true) }
|
@@ -104,12 +104,13 @@ describe Encore::Serializer do
|
|
104
104
|
spawn_serializer('ProjectSerializer') do
|
105
105
|
attributes :name
|
106
106
|
end
|
107
|
-
|
108
107
|
end
|
108
|
+
|
109
109
|
let(:create_records!) do
|
110
110
|
User.create name: 'Allan', project_id: 1
|
111
111
|
User.create name: 'Doe', project_id: 2
|
112
112
|
end
|
113
|
+
|
113
114
|
let(:include) { '' }
|
114
115
|
|
115
116
|
it { expect(serialized[:users][0][:links][:project].present?).to eq(false) }
|
@@ -134,12 +135,13 @@ describe Encore::Serializer do
|
|
134
135
|
spawn_serializer('ProjectSerializer') do
|
135
136
|
attributes :name
|
136
137
|
end
|
137
|
-
|
138
138
|
end
|
139
|
+
|
139
140
|
let(:create_records!) do
|
140
141
|
User.create name: 'Allan', project_id: 1
|
141
142
|
User.create name: 'Doe', project_id: 2
|
142
143
|
end
|
144
|
+
|
143
145
|
let(:include) { 'project' }
|
144
146
|
|
145
147
|
it { expect(serialized[:users][0][:links][:project].present?).to eq(true) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: encore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Prévost
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|