Fix rubocop complaints
This commit is contained in:
parent
a093837e99
commit
b430975cc9
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -7,7 +7,7 @@ jobs:
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: [2.4, 2.5, 2.6, 2.7]
|
||||
ruby: [2.4, 2.5, 2.6, 2.7, 3.0]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
@ -10,7 +10,7 @@ module FastJsonapi
|
||||
# from explictly defined procs/lambdas, so we can't deduce the number of
|
||||
# parameters from the array length. Instead, look for an unnamed
|
||||
# parameter in the first position just pass the record as the receiver obj.
|
||||
if proc.parameters.length > 0 && proc.parameters.first[1].nil?
|
||||
if proc.parameters.positive? && !proc.parameters.empty?
|
||||
proc.call(params.first)
|
||||
else
|
||||
proc.call(*params.take(proc.parameters.length))
|
||||
|
@ -12,12 +12,7 @@ module FastJsonapi
|
||||
object_block:,
|
||||
serializer:,
|
||||
relationship_type:,
|
||||
cached: false,
|
||||
polymorphic:,
|
||||
conditional_proc:,
|
||||
transform_method:,
|
||||
links:,
|
||||
meta:,
|
||||
polymorphic:, conditional_proc:, transform_method:, links:, meta:, cached: false,
|
||||
lazy_load_data: false
|
||||
)
|
||||
@owner = owner
|
||||
|
@ -3,6 +3,7 @@
|
||||
module JSONAPI
|
||||
module Serializer
|
||||
class Error < StandardError; end
|
||||
|
||||
class UnsupportedIncludeError < Error
|
||||
attr_reader :include_item, :klass
|
||||
|
||||
|
2
spec/fixtures/movie.rb
vendored
2
spec/fixtures/movie.rb
vendored
@ -50,7 +50,7 @@ class MovieSerializer
|
||||
|
||||
attribute :released_in_year, &:year
|
||||
attributes :name
|
||||
attribute :release_year do |object, params|
|
||||
attribute :release_year do |object, _params|
|
||||
object.year
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user