diff --git a/.rubocop.yml b/.rubocop.yml index 3ee5cbe..568b758 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,12 +7,6 @@ AllCops: - "vendor/**/*" Metrics/AbcSize: Max: 40 -Metrics/LineLength: - Max: 125 - AllowURI: true - URISchemes: - - http - - https Metrics/MethodLength: Max: 20 Metrics/CyclomaticComplexity: @@ -21,18 +15,36 @@ Metrics/PerceivedComplexity: Max: 10 Metrics/BlockLength: Enabled: false -Documentation: +Style/Documentation: Enabled: false Style/SignalException: EnforcedStyle: only_raise -Layout/IndentHash: +Layout/LineLength: + Max: 125 + AllowURI: true + URISchemes: + - http + - https +Layout/FirstHashElementIndentation: EnforcedStyle: consistent -Layout/IndentArray: +Layout/FirstArrayElementIndentation: EnforcedStyle: consistent Layout/EndAlignment: EnforcedStyleAlignWith: variable Lint/InheritException: Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Style/HashEachMethods: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false Style/FrozenStringLiteralComment: Enabled: false RSpec/AnyInstance: diff --git a/.travis.yml b/.travis.yml index 0a55624..fd666b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ rvm: - 2.5 - 2.6 - 2.7 + - 3.0 + - 3.1 env: jobs: - @@ -13,6 +15,8 @@ env: - ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13 - ACTIVE_RECORD_VERSION=5.0.0 SQLITE3_VERSION=1.3.13 - ACTIVE_RECORD_VERSION=6.0.0 + - ACTIVE_RECORD_VERSION=6.1.0 + - ACTIVE_RECORD_VERSION=7.0.0 matrix: allow_failures: - rvm: 2.4 @@ -33,8 +37,36 @@ matrix: env: ACTIVE_RECORD_VERSION=4.1.0 SQLITE3_VERSION=1.3.13 - rvm: 2.7 env: ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.0 + env: ACTIVE_RECORD_VERSION=4.0.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.0 + env: ACTIVE_RECORD_VERSION=4.1.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.0 + env: ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.0 + env: ACTIVE_RECORD_VERSION=5.0.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.1 + env: ACTIVE_RECORD_VERSION=4.0.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.1 + env: ACTIVE_RECORD_VERSION=4.1.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.1 + env: ACTIVE_RECORD_VERSION=4.2.0 SQLITE3_VERSION=1.3.13 + - rvm: 3.1 + env: ACTIVE_RECORD_VERSION=5.0.0 SQLITE3_VERSION=1.3.13 - rvm: 2.4 env: ACTIVE_RECORD_VERSION=6.0.0 + - rvm: 3.0 + env: ACTIVE_RECORD_VERSION=6.0.0 + - rvm: 3.1 + env: ACTIVE_RECORD_VERSION=6.0.0 + - rvm: 2.4 + env: ACTIVE_RECORD_VERSION=6.1.0 + - rvm: 2.4 + env: ACTIVE_RECORD_VERSION=7.0.0 + - rvm: 2.5 + env: ACTIVE_RECORD_VERSION=7.0.0 + - rvm: 2.6 + env: ACTIVE_RECORD_VERSION=7.0.0 before_install: - gem update --system - gem --version diff --git a/acts_as_hashids.gemspec b/acts_as_hashids.gemspec index f6134f3..ecee755 100644 --- a/acts_as_hashids.gemspec +++ b/acts_as_hashids.gemspec @@ -19,16 +19,16 @@ Gem::Specification.new do |spec| spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.required_ruby_version = ['>= 2.2.2', '< 3.0'] + spec.required_ruby_version = ['>= 2.3.0', '< 3.2'] - spec.add_runtime_dependency 'activerecord', '>= 4.0', '< 6.1' + spec.add_runtime_dependency 'activerecord', '>= 4.0', '< 7.1' spec.add_runtime_dependency 'hashids', '~> 1.0' spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.5' spec.add_development_dependency 'coveralls', '~> 0.8' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'rubocop', '~> 0.54.0' + spec.add_development_dependency 'rubocop', '~> 0.81.0' spec.add_development_dependency 'rubocop-rspec', '~> 1.24.0' spec.add_development_dependency 'simplecov', '~> 0.11' spec.add_development_dependency 'sqlite3', '~> 1.3' diff --git a/lib/acts_as_hashids/core.rb b/lib/acts_as_hashids/core.rb index 6048a4b..19c3aae 100644 --- a/lib/acts_as_hashids/core.rb +++ b/lib/acts_as_hashids/core.rb @@ -59,10 +59,10 @@ def with_hashids(*ids) where(primary_key => decoded_ids) end - def has_many(*args, &block) # rubocop:disable Style/PredicateName + def has_many(*args, &block) # rubocop:disable Naming/PredicateName options = args.extract_options! options[:extend] = (options[:extend] || []).concat([FinderMethods]) - super(*args, options, &block) + super(*args, **options, &block) end def relation