jsonapi-resources 0.10.3 → 0.10.4

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
  SHA256:
3
- metadata.gz: 12f47ee89d33c3dc5b366b6538fe8af7719516ae5dfedab08f9d70ae28f378c9
4
- data.tar.gz: 67c77d1af31817ed6126f43481fd3cc122dc9387c2187c0d09fd29503a402e58
3
+ metadata.gz: f0373c84cc7d1e7fa2da86da83b30db06192824ecd5261718d167ddcbd7d3c3d
4
+ data.tar.gz: 4f2667a8a42ed1a4c91100979e047a0fafedc0467d84bd13e487fc7cb8baf60d
5
5
  SHA512:
6
- metadata.gz: d7c39545ce4f74f8068c8841796806ba5c757bac2bd830fd0bacb1facd21810bfbcb5e40b2ec501cf9558e1069ff9e3dfaf43b7a942b17200dcdf028a0e98432
7
- data.tar.gz: 3ef5723ed2f96673d14372a2c11f28224d381fabe9a8c8b3b9373f8d6868a930de49349cdccff9203dab6b417241043635b84a9470bf41c4fb96096991b61e98
6
+ metadata.gz: 6d080b0c4fcd192780be59c59158149081d7873301e36870335df9e362cc025d58b471d5677c7ba53c0d1b90c299cd41dea8975239fbd0510cdf0a9eb6a39cfb
7
+ data.tar.gz: 726d7c41751b41f79e1dfa6c6e6f4cd85d35c2a4e713d6836f8e1e8e8b275c74c62053fb1e95b278e6821732e81159cacdd6424482a182bc577ff56c0af767df
@@ -756,7 +756,7 @@ module JSONAPI
756
756
 
757
757
  # Assumes ActiveRecord's counting. Override if you need a different counting method
758
758
  def count_records(records)
759
- if Rails::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
759
+ if (Rails::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR >= 1) || Rails::VERSION::MAJOR >= 6
760
760
  records.count(:all)
761
761
  else
762
762
  records.count
@@ -418,7 +418,7 @@ module JSONAPI
418
418
  sorts = sort_criteria
419
419
  elsif sort_criteria.is_a?(String)
420
420
  begin
421
- raw = URI.unescape(sort_criteria)
421
+ raw = URI.decode_www_form_component(sort_criteria)
422
422
  sorts = CSV.parse_line(raw)
423
423
  rescue CSV::MalformedCSVError
424
424
  fail JSONAPI::Exceptions::InvalidSortCriteria.new(format_key(resource_klass._type), raw)
@@ -5,10 +5,10 @@ module JSONAPI
5
5
  ActionController::Rendering,
6
6
  ActionController::Renderers::All,
7
7
  ActionController::StrongParameters,
8
- ActionController::ForceSSL,
8
+ Gem::Requirement.new('< 6.1').satisfied_by?(ActionPack.gem_version) ? ActionController::ForceSSL : nil,
9
9
  ActionController::Instrumentation,
10
10
  JSONAPI::ActsAsResourceController
11
- ].freeze
11
+ ].compact.freeze
12
12
 
13
13
  # Note, the url_helpers are not loaded. This will prevent links from being generated for resources, and warnings
14
14
  # will be emitted. Link support can be added by including `Rails.application.routes.url_helpers`, and links
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.10.3'
3
+ VERSION = '0.10.4'
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.10.3
4
+ version: 0.10.4
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: 2021-01-28 00:00:00.000000000 Z
12
+ date: 2021-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  - !ruby/object:Gem::Version
248
248
  version: '0'
249
249
  requirements: []
250
- rubygems_version: 3.2.3
250
+ rubygems_version: 3.0.3
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Easily support JSON API in Rails.