jsonapi-resources 0.9.0.beta3 → 0.9.0
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/jsonapi/processor.rb +1 -1
- data/lib/jsonapi/request_parser.rb +1 -1
- data/lib/jsonapi/resource.rb +2 -2
- data/lib/jsonapi/resources/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a367b0f58fd1570cdc45f28570f440ab2b68c1c7
|
|
4
|
+
data.tar.gz: 48fdfb4691776dea1491b237c7f9fc1eca401072
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1664c0f610a4baaa22c80642575cdb177910476d0d3154bf259902e24b27261ee26b2f385820a360bb50a229a5e74c04ed55fd69f6507ab3596db6cf5324cc9
|
|
7
|
+
data.tar.gz: b372447e19a732fadcdb1154894f963460187a2b92e5481df411b798b27347808f4d79f90c51f49b6198a95cd7c1e2d05901ca5a42463064ee89340c80ffa4ad
|
data/lib/jsonapi/processor.rb
CHANGED
|
@@ -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
|
data/lib/jsonapi/resource.rb
CHANGED
|
@@ -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.
|
|
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
|
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
|
|
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-
|
|
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:
|
|
217
|
+
version: '0'
|
|
218
218
|
requirements: []
|
|
219
219
|
rubyforge_project:
|
|
220
|
-
rubygems_version: 2.
|
|
220
|
+
rubygems_version: 2.5.1
|
|
221
221
|
signing_key:
|
|
222
222
|
specification_version: 4
|
|
223
223
|
summary: Easily support JSON API in Rails.
|