fun_with_json_api 0.0.11.3 → 0.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8fe4d42885d4ffde18e6906b4e5d4a70370a0f0c
4
- data.tar.gz: 7a3d10522d1cfe3038c466ab9fd23913e3125ca9
2
+ SHA256:
3
+ metadata.gz: 7d1a03f1e96d729456ac611fcffec59bc16aa2924f8230f04cbcf232034717d8
4
+ data.tar.gz: a1e03d0552be4c1e49c6f56be013619cca221b08e3dcde68f883e7eb73345235
5
5
  SHA512:
6
- metadata.gz: 34d7211d6b55a3af8ad13f9a4879cc86d7400985c8a1efad815e83565c41f43c36d4b0d1b076ee7a6b7d6ec1a209033306714bf9f5157a4a5e3dec30362d107f
7
- data.tar.gz: a549b8c522b369d83fdb842797afc15bc88cccbc0f423ab4222ba8091a60dfad2230ede8b166ce8a81d0ffa75eb98ff740e96f4273118136110367a330a31e4b
6
+ metadata.gz: 659ccdb1092b4a1bba10bcb8c2666cc14ac7f40803837cd134264c87ebb46fef14f09c50a94d7fac4eea85564a9be475440925543202a47873f52986debfa130
7
+ data.tar.gz: e11517115fb82e7f62783a135890691f7ab7faf74eec97f0b975c0c5fef175cd20f680019422c9279e2fce31842f30fd3d9f40f8f3e6404295ba8e8fb91e629b
@@ -6,7 +6,7 @@ module FunWithJsonApi
6
6
  unless value.to_s =~ /[0-9]+(\.[0-9]+)?/
7
7
  raise build_invalid_attribute_error(value)
8
8
  end
9
- BigDecimal.new(value.to_s)
9
+ BigDecimal(value.to_s)
10
10
  end
11
11
  end
12
12
 
@@ -3,8 +3,8 @@ require 'fun_with_json_api/schema_validators/check_collection_has_all_members'
3
3
 
4
4
  module FunWithJsonApi
5
5
  class FindCollectionFromDocument
6
- def self.find(*args)
7
- new(*args).find
6
+ def self.find(...)
7
+ new(...).find
8
8
  end
9
9
 
10
10
  private_class_method :new
@@ -1,7 +1,7 @@
1
1
  module FunWithJsonApi
2
2
  class FindResourceFromDocument
3
- def self.find(*args)
4
- new(*args).find
3
+ def self.find(...)
4
+ new(...).find
5
5
  end
6
6
 
7
7
  private_class_method :new
@@ -9,7 +9,7 @@ module FunWithJsonApi
9
9
 
10
10
  def call(env)
11
11
  @app.call(env)
12
- rescue ActionDispatch::ParamsParser::ParseError => error
12
+ rescue ActionDispatch::Http::Parameters::ParseError => error
13
13
  if env['CONTENT_TYPE'] =~ JSON_API_REGEX && respond_with_json_api_error?(env)
14
14
  build_json_api_parse_error_response
15
15
  else
@@ -24,16 +24,10 @@ module FunWithJsonApi
24
24
  end
25
25
 
26
26
  # Add Middleware for catching parser errors
27
- if Rails::VERSION::MAJOR >= 5
28
- ActionDispatch::Request.parameter_parsers = parsers::DEFAULT_PARSERS
29
- app.config.middleware.use(
30
- 'FunWithJsonApi::Middleware::CatchJsonApiParseErrors'
31
- )
32
- else
33
- app.config.middleware.insert_before(
34
- parsers, 'FunWithJsonApi::Middleware::CatchJsonApiParseErrors'
35
- )
36
- end
27
+ ActionDispatch::Request.parameter_parsers = parsers::DEFAULT_PARSERS
28
+ app.config.middleware.use(
29
+ FunWithJsonApi::Middleware::CatchJsonApiParseErrors
30
+ )
37
31
  end
38
32
  initializer :register_json_api_renderer do
39
33
  ActionController::Renderers.add :json_api do |json, options|
@@ -3,8 +3,8 @@ require 'fun_with_json_api/exception'
3
3
  module FunWithJsonApi
4
4
  module SchemaValidators
5
5
  class CheckCollectionHasAllMembers
6
- def self.call(*args)
7
- new(*args).call
6
+ def self.call(...)
7
+ new(...).call
8
8
  end
9
9
 
10
10
  attr_reader :collection
@@ -3,8 +3,8 @@ require 'fun_with_json_api/exception'
3
3
  module FunWithJsonApi
4
4
  module SchemaValidators
5
5
  class CheckCollectionIsAuthorised
6
- def self.call(*args)
7
- new(*args).call
6
+ def self.call(...)
7
+ new(...).call
8
8
  end
9
9
 
10
10
  attr_reader :collection
@@ -2,8 +2,8 @@ module FunWithJsonApi
2
2
  module SchemaValidators
3
3
  # Ensures all provided relationship names are known
4
4
  class CheckRelationshipNames
5
- def self.call(*args)
6
- new(*args).call
5
+ def self.call(...)
6
+ new(...).call
7
7
  end
8
8
 
9
9
  attr_reader :document
@@ -3,8 +3,8 @@ require 'fun_with_json_api/exception'
3
3
  module FunWithJsonApi
4
4
  module SchemaValidators
5
5
  class CheckResourceIsAuthorised
6
- def self.call(*args)
7
- new(*args).call
6
+ def self.call(...)
7
+ new(...).call
8
8
  end
9
9
 
10
10
  attr_reader :resource
@@ -1,3 +1,3 @@
1
1
  module FunWithJsonApi
2
- VERSION = '0.0.11.3'.freeze
2
+ VERSION = '0.0.14'.freeze
3
3
  end
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts .js
2
+ //= link_directory ../stylesheets .css