diff --git a/.rubocop.yml b/.rubocop.yml index 43c5fb3d..391a22ef 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,8 +5,6 @@ AllCops: - tmp/**/* HandleExceptions: Enabled: false -NonNilCheck: - Enabled: false PercentLiteralDelimiters: PreferredDelimiters: '%W': '[]' diff --git a/README.md b/README.md index a6277eaf..5b7207f4 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,7 @@ work done in [Mutations][17]. [2]: https://badge.fury.io/rb/active_interaction "Gem Version" [3]: https://travis-ci.org/orgsync/active_interaction.svg?branch=master [4]: https://travis-ci.org/orgsync/active_interaction "Build Status" - [5]: https://coveralls.io/repos/orgsync/active_interaction/badge.png?branch=master + [5]: http://img.shields.io/coveralls/orgsync/active_interaction/master.svg [6]: https://coveralls.io/r/orgsync/active_interaction?branch=master "Coverage Status" [7]: https://codeclimate.com/github/orgsync/active_interaction.png [8]: https://codeclimate.com/github/orgsync/active_interaction "Code Climate" diff --git a/active_interaction.gemspec b/active_interaction.gemspec index 242d4922..93183860 100644 --- a/active_interaction.gemspec +++ b/active_interaction.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'guard-rubocop', '~> 1.1' spec.add_development_dependency 'rake', '~> 10.3' spec.add_development_dependency 'rdoc', '~> 4.1' - spec.add_development_dependency 'rubocop', '0.21.0' + spec.add_development_dependency 'rubocop', '0.22.0' spec.add_development_dependency 'yard', '~> 0.8' if RUBY_ENGINE == 'rbx' diff --git a/lib/active_interaction/errors.rb b/lib/active_interaction/errors.rb index 75d4cd91..ebbd3a3c 100644 --- a/lib/active_interaction/errors.rb +++ b/lib/active_interaction/errors.rb @@ -171,9 +171,9 @@ def merge_messages!(other) def merge_symbolic!(other) other.symbolic.each do |attribute, symbols| symbols.each do |symbol| - unless symbolic[attribute].include?(symbol) - symbolic[attribute] += [symbol] - end + next if symbolic[attribute].include?(symbol) + + symbolic[attribute] += [symbol] end end end diff --git a/lib/active_interaction/filters/array_filter.rb b/lib/active_interaction/filters/array_filter.rb index 624166c9..98ed4e1c 100644 --- a/lib/active_interaction/filters/array_filter.rb +++ b/lib/active_interaction/filters/array_filter.rb @@ -64,9 +64,11 @@ def validate(filter, names) fail InvalidFilterError, 'attribute names in array block' end + # rubocop:disable GuardClause if filter.default? fail InvalidDefaultError, 'default values in array block' end + # rubocop:enable GuardClause end end end