Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeagusamuel committed Jun 6, 2024
1 parent 2e770be commit c7a6c0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/chewy/fields/root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Root < Chewy::Fields::Base
attr_reader :dynamic_templates, :id

def initialize(name, **options)
super(name, **options)
super

@value ||= -> { self }
@dynamic_templates = []
Expand Down
4 changes: 2 additions & 2 deletions spec/chewy/fields/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
specify { expect(described_class.new('name', type: 'integer').options[:type]).to eq('integer') }

describe '#compose' do
let(:field) { described_class.new(:name, value: ->(o) { o.value }) }
let(:field) { described_class.new(:name, value: lambda(&:value)) }

specify { expect(field.compose(double(value: 'hello'))).to eq(name: 'hello') }
specify { expect(field.compose(double(value: %w[hello world]))).to eq(name: %w[hello world]) }
Expand All @@ -23,7 +23,7 @@

context 'nested fields' do
before do
field.children.push(described_class.new(:subname1, value: ->(o) { o.subvalue1 }))
field.children.push(described_class.new(:subname1, value: lambda(&:subvalue1)))
field.children.push(described_class.new(:subname2, value: -> { subvalue2 }))
field.children.push(described_class.new(:subname3))
end
Expand Down
2 changes: 1 addition & 1 deletion spec/chewy/index/observe/callback_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

context 'when executable is has arity 1' do
let(:executable) { ->(record) { record.population } }
let(:executable) { lambda(&:population) }

it 'calls exectuable within context' do
expect(callback.call(city)).to eq(city.population)
Expand Down

0 comments on commit c7a6c0d

Please sign in to comment.