jsonapi-resources 0.9.0.beta3 → 0.9.0

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: fc4d9609ab4583905bdd873a5441c18b61070815
4
- data.tar.gz: 77f715f9ae01ace74fb4b806e72958f7aa63c7af
3
+ metadata.gz: a367b0f58fd1570cdc45f28570f440ab2b68c1c7
4
+ data.tar.gz: 48fdfb4691776dea1491b237c7f9fc1eca401072
5
5
  SHA512:
6
- metadata.gz: 597b6fa8abcb568db3220f549f02bfce0be036668adcd4174a114eaa28d8ea44eb83d5c9478f87934adfe7d3c1b1bfad08432927e4817dbd7481bdbfb2cc555b
7
- data.tar.gz: 5cb094596df3b6977981de5c8bdecaf95b70a62a3db475d40b9d92f35599325a62ef812801c1f57557a7562e9287c427121db2ab703403b6558ba28195f50057
6
+ metadata.gz: a1664c0f610a4baaa22c80642575cdb177910476d0d3154bf259902e24b27261ee26b2f385820a360bb50a229a5e74c04ed55fd69f6507ab3596db6cf5324cc9
7
+ data.tar.gz: b372447e19a732fadcdb1154894f963460187a2b92e5481df411b798b27347808f4d79f90c51f49b6198a95cd7c1e2d05901ca5a42463064ee89340c80ffa4ad
@@ -96,7 +96,7 @@ module JSONAPI
96
96
  end
97
97
 
98
98
  if (JSONAPI.configuration.top_level_meta_include_page_count && page_options[:record_count])
99
- page_options[:page_count] = paginator.calculate_page_count(page_options[:record_count])
99
+ page_options[:page_count] = paginator ? paginator.calculate_page_count(page_options[:record_count]) : 1
100
100
  end
101
101
 
102
102
  if JSONAPI.configuration.top_level_links_include_pagination && paginator
@@ -226,7 +226,7 @@ module JSONAPI
226
226
 
227
227
  return if included_resources.empty?
228
228
 
229
- result = included_resources.map do |included_resource|
229
+ result = included_resources.compact.map do |included_resource|
230
230
  check_include(@resource_klass, included_resource.partition('.'))
231
231
  unformat_key(included_resource).to_s
232
232
  end
@@ -656,7 +656,7 @@ module JSONAPI
656
656
  associations = _lookup_association_chain([records.model.to_s, *model_names])
657
657
  joins_query = _build_joins([records.model, *associations])
658
658
 
659
- # _sorting is appended to avoid name clashes with manual joins eg. overriden filters
659
+ # _sorting is appended to avoid name clashes with manual joins eg. overridden filters
660
660
  order_by_query = "#{associations.last.name}_sorting.#{column_name} #{direction}"
661
661
  records = records.joins(joins_query).order(order_by_query)
662
662
  else
@@ -1001,7 +1001,7 @@ module JSONAPI
1001
1001
 
1002
1002
  @model_class = model_name.to_s.safe_constantize
1003
1003
  if @model_class.nil?
1004
- warn "[MODEL NOT FOUND] Model could not be found for #{self.name}. If this a base Resource declare it as abstract."
1004
+ warn "[MODEL NOT FOUND] Model could not be found for #{self.name}. If this is a base Resource declare it as abstract."
1005
1005
  end
1006
1006
 
1007
1007
  @model_class
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.9.0.beta3'
3
+ VERSION = '0.9.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.beta3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gebhardt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-19 00:00:00.000000000 Z
12
+ date: 2017-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -212,12 +212,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
212
  version: '2.1'
213
213
  required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  requirements:
215
- - - ">"
215
+ - - ">="
216
216
  - !ruby/object:Gem::Version
217
- version: 1.3.1
217
+ version: '0'
218
218
  requirements: []
219
219
  rubyforge_project:
220
- rubygems_version: 2.6.8
220
+ rubygems_version: 2.5.1
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: Easily support JSON API in Rails.