Skip to content

Commit

Permalink
Update rubocop requirement from ~> 1.0.0 to ~> 1.1.0
Browse files Browse the repository at this point in the history
Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.0.0...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
  • Loading branch information
dependabot-preview[bot] authored and tagliala committed Oct 31, 2020
1 parent 74e4b32 commit 7cf0016
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client_side_validations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.14'
spec.add_development_dependency 'mocha', '~> 1.11'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.0.0'
spec.add_development_dependency 'rubocop', '~> 1.1.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.8'
spec.add_development_dependency 'rubocop-rails', '~> 2.8'
spec.add_development_dependency 'simplecov', '>= 0.18.5', '< 0.20'
Expand Down
6 changes: 3 additions & 3 deletions lib/client_side_validations/active_model/conditionals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def run_one_conditional(conditional)
raise ArgumentError, 'Missing argument'
end
when String
# rubocop:disable Security/Eval'
l = eval("lambda { |value| #{conditional} }", binding, __FILE__, __LINE__)
# rubocop:enable Security/Eval'
# rubocop:disable Security/Eval, Style/DocumentDynamicEvalDefinition
l = eval("->(value) { #{conditional} }", binding, __FILE__, __LINE__)
# rubocop:enable Security/Eval, Style/DocumentDynamicEvalDefinition
instance_exec(nil, &l)
when Symbol
send conditional
Expand Down
2 changes: 1 addition & 1 deletion test/active_model/cases/test_validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_conditionals_when_combination_is_given
p.validates :first_name, presence: { if: [:can_validate?, proc { true }] }
p.validates :last_name, presence: { unless: [:cannot_validate?, proc { false }] }
else
p.validates :first_name, presence: { if: [:can_validate?, 'last_name.nil?', proc { true }] }
p.validates :first_name, presence: { if: [:can_validate?, 'value.nil?', proc { true }] }
p.validates :last_name, presence: { unless: [:cannot_validate?, '!first_name.nil?', proc { false }] }
end
end
Expand Down

0 comments on commit 7cf0016

Please sign in to comment.