Skip to content

Commit

Permalink
rubocopify
Browse files Browse the repository at this point in the history
  • Loading branch information
ermolaev committed Jan 12, 2025
1 parent 48ed563 commit 4082366
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/active_dry_form/base_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def to_param
end

def validate
@validator = self.class::CURRENT_CONTRACT.call(attributes, { form: self, record: record })
@validator = self.class::CURRENT_CONTRACT.call(attributes, { form: self, record: })
@data = @validator.values.data
@errors = @validator.errors.to_h
@base_errors = @validator.errors.filter(:base?).map(&:to_s)
Expand Down
2 changes: 1 addition & 1 deletion lib/active_dry_form/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def show_error(field)
ActiveDryForm::Input.new(self, nil, field, {}).error_text
end

def button(value = nil, options = {}, &block)
def button(value = nil, options = {}, &)
options[:class] = [options[:class], 'button'].compact
super
end
Expand Down
2 changes: 1 addition & 1 deletion spec/active_dry_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
user.update!(second_name: 'Sidorov')
params = ActionController::Parameters.new(user: { name: 'Ivan', second_name: '' })

form = UserForm.new(record: user, params: params)
form = UserForm.new(record: user, params:)

expect(form.second_name).to be_nil
end
Expand Down
4 changes: 2 additions & 2 deletions spec/app/nested_dry_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def omniplatform?
fields(:user) do
params do
optional(:name).maybe(:string)
optional(:bookmarks).array(Dry.Types.Constructor(BookmarkForm) { |params| BookmarkForm.new(params: params) })
optional(:personal_info).value(Dry.Types.Constructor(PersonalInfoForm) { |params| PersonalInfoForm.new(params: params) })
optional(:bookmarks).array(Dry.Types.Constructor(BookmarkForm) { |params| BookmarkForm.new(params:) })
optional(:personal_info).value(Dry.Types.Constructor(PersonalInfoForm) { |params| PersonalInfoForm.new(params:) })
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'bundler'
Bundler.require :default

Dir["#{File.dirname(__FILE__)}/support/*.rb"].sort.each { |f| require f }
Dir["#{File.dirname(__FILE__)}/support/*.rb"].each { |f| require f }

I18n.load_path = Dir.glob("#{__dir__}/app/*.yml")
I18n.available_locales = %i[ru en]
Expand Down

0 comments on commit 4082366

Please sign in to comment.