jsonapi-resources 0.10.0.beta8 → 0.10.0.beta9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a8c66a46d4472b937170a49042d8562590625617e7cacf7ffeea41a82833f6
|
4
|
+
data.tar.gz: '056962b1332867b7d5c787c896ab27b09dbc20f32fc1e393bab92926368d0d4e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7054515d6f28adb20a7df94f9fe85a70cd7489f3e75a89eca4daa6b7c75d056a34512fe825dc9c2b12ca4c2e3e0bc0ca10f3db27586e91b757b06bd72b04dad1
|
7
|
+
data.tar.gz: 99514c00fa4f01507f38a60c8c62796790116e60406bee10666c83fef3072a572b03a33a4a9867741064ed60d1337e9c73f83a4c7d52fd8483821bac0958ef9b
|
data/lib/jsonapi-resources.rb
CHANGED
@@ -7,7 +7,13 @@ require 'jsonapi/resource'
|
|
7
7
|
require 'jsonapi/cached_response_fragment'
|
8
8
|
require 'jsonapi/response_document'
|
9
9
|
require 'jsonapi/acts_as_resource_controller'
|
10
|
-
|
10
|
+
if Rails::VERSION::MAJOR >= 6
|
11
|
+
ActiveSupport.on_load(:action_controller_base) do
|
12
|
+
require 'jsonapi/resource_controller'
|
13
|
+
end
|
14
|
+
else
|
15
|
+
require 'jsonapi/resource_controller'
|
16
|
+
end
|
11
17
|
require 'jsonapi/resource_controller_metal'
|
12
18
|
require 'jsonapi/resources/version'
|
13
19
|
require 'jsonapi/configuration'
|
@@ -8,7 +8,7 @@ module JSONAPI
|
|
8
8
|
# example Post.joins(:comments).joins_left(comments: :author) will join the comments table twice,
|
9
9
|
# once inner and once left in 5.2, but only as inner in earlier versions.
|
10
10
|
def joins_left(*columns)
|
11
|
-
if Rails::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 2
|
11
|
+
if Rails::VERSION::MAJOR >= 6 || (Rails::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 2)
|
12
12
|
left_joins(columns)
|
13
13
|
else
|
14
14
|
join_dependency = ActiveRecord::Associations::JoinDependency.new(self, columns, [])
|
@@ -152,7 +152,7 @@ module JSONAPI
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def base_url
|
155
|
-
@base_url ||= request.protocol
|
155
|
+
@base_url ||= "#{request.protocol}#{request.host_with_port}#{Rails.application.config.relative_url_root}"
|
156
156
|
end
|
157
157
|
|
158
158
|
def resource_klass_name
|
@@ -131,7 +131,7 @@ module JSONAPI
|
|
131
131
|
def config_description(resource_klass)
|
132
132
|
{
|
133
133
|
class_name: self.class.name,
|
134
|
-
|
134
|
+
serialization_options: serialization_options.sort.map(&:as_json),
|
135
135
|
supplying_attribute_fields: supplying_attribute_fields(resource_klass).sort,
|
136
136
|
supplying_relationship_fields: supplying_relationship_fields(resource_klass).sort,
|
137
137
|
link_builder_base_url: link_builder.base_url,
|
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.0.
|
4
|
+
version: 0.10.0.beta9
|
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: 2019-
|
12
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 1.17.3
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 1.17.3
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
240
|
requirements:
|
241
241
|
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: '2.
|
243
|
+
version: '2.3'
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
246
|
- - ">"
|