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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 723164fd61a92235eaac47843e2ed972c2d5c57b
4
- data.tar.gz: 0fdfba4c4088a0cdfad32b9549951138befeff20
3
+ metadata.gz: 21758c507cf16a19783160bbe8def677e038051d
4
+ data.tar.gz: 9ea74add7b1302b2ea1494cbd34230d14ac99e6d
5
5
  SHA512:
6
- metadata.gz: a1da57f4c3ccaa478dec254bbd1c2058c722c7212d3e0fac524f4db11541a2297ad75db4e2176b50d8483fd3cdb9f0ccf5c5ad7557cee5531747d152606ddf17
7
- data.tar.gz: e901741536ae58e5e1529e6e92e62d89cc70c6f00eb0d0663481d0b283e23f6077fde90306ac920c11437c70a8daac154d10193eff7b77d34aff87d8b2feaffd
6
+ metadata.gz: 64ec538a05a209fce5b03f3bc082a14a7561bb948fc4330196a25022587a594138b1d7dcd61614578d537fec7d5755ef55238231aa114366fa957f97d0b2f3d0
7
+ data.tar.gz: d528113ef87bad63d5b0a848e16e6925d38e0ad642f4c57ea1a89ffc5e43b8e2c1e9326f0cf7493697cff562eb390ea55e26d34cfc46855d2e1b36f0a181618e
@@ -8,6 +8,7 @@ gemfile:
8
8
  - gemfiles/Gemfile.activerecord-4.0
9
9
  - gemfiles/Gemfile.activerecord-4.1.3
10
10
  - gemfiles/Gemfile.activerecord-4.1.4
11
+ - gemfiles/Gemfile.activerecord-4.2
11
12
 
12
13
  script:
13
14
  - 'echo "Checking code style" && bundle exec phare'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Encore
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -44,8 +44,8 @@ describe Encore::Serializer do
44
44
  spawn_serializer('ProjectSerializer') do
45
45
  attributes :name
46
46
  end
47
-
48
47
  end
48
+
49
49
  let(:create_records!) do
50
50
  User.create name: 'Allan', project_id: 1
51
51
  User.create name: 'Doe', project_id: 2
@@ -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.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: 2014-07-28 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel