diff --git a/.rubocop_rails.yml b/.rubocop_rails.yml index 1d1371e..19de2a7 100644 --- a/.rubocop_rails.yml +++ b/.rubocop_rails.yml @@ -91,3 +91,6 @@ Rails/SkipsModelValidations: Rails/Validation: Include: - decidim-*/app/models/**/*.rb + +FactoryBot/FactoryAssociationWithStrategy: + Enabled: false \ No newline at end of file diff --git a/.rubocop_ruby.yml b/.rubocop_ruby.yml index c5346f7..c688d07 100644 --- a/.rubocop_ruby.yml +++ b/.rubocop_ruby.yml @@ -528,6 +528,8 @@ Style/GuardClause: MinBodyLength: 6 Style/HashSyntax: + Exclude: + - app/jobs/decidim/cleaner/clean_inactive_users_job.rb EnforcedStyle: ruby19 SupportedStyles: # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys diff --git a/Gemfile b/Gemfile index 842faba..f729e52 100644 --- a/Gemfile +++ b/Gemfile @@ -12,8 +12,8 @@ gem "puma", ">= 4.3" group :development, :test do gem "byebug", "~> 11.0", platform: :mri - gem "decidim-dev", git: "https://github.com/decidim/decidim" + gem "rubocop-rails", "~> 2.19.0" end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 6d1822d..798bb91 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -473,6 +473,8 @@ GEM nio4r (2.5.9) nokogiri (1.14.5-arm64-darwin) racc (~> 1.4) + nokogiri (1.14.5-x86_64-linux) + racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) snaky_hash (~> 2.0) @@ -652,7 +654,7 @@ GEM rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) - rubocop-rails (2.22.1) + rubocop-rails (2.19.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -762,6 +764,7 @@ GEM PLATFORMS arm64-darwin-22 + x86_64-linux DEPENDENCIES bootsnap (~> 1.4) @@ -773,6 +776,7 @@ DEPENDENCIES letter_opener_web (~> 2.0) listen (~> 3.1) puma (>= 4.3) + rubocop-rails (~> 2.19.0) spring (~> 2.0) spring-watcher-listen (~> 2.0) web-console (~> 4.2) diff --git a/app/jobs/decidim/cleaner/clean_inactive_users_job.rb b/app/jobs/decidim/cleaner/clean_inactive_users_job.rb index 0b5a4eb..236f43a 100644 --- a/app/jobs/decidim/cleaner/clean_inactive_users_job.rb +++ b/app/jobs/decidim/cleaner/clean_inactive_users_job.rb @@ -9,11 +9,11 @@ def perform Decidim::Organization.find_each do |organization| next unless organization.delete_inactive_users? - send_warning(Decidim::User.unscoped.where(organization:) + send_warning(Decidim::User.unscoped.where(organization: organization) .not_deleted .where.not(email: "") .where("current_sign_in_at < ?", email_inactive_before_date(organization))) - delete_user_and_send_email(Decidim::User.unscoped.where(organization:) + delete_user_and_send_email(Decidim::User.unscoped.where(organization: organization) .not_deleted .where.not(email: "") .where("warning_date < ?", delete_inactive_before_date(organization))) diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index d7fa325..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "decidim-module-cleaner", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/spec/commands/decidim/cleaner/admin/update_organization_cleaner_spec.rb b/spec/commands/decidim/cleaner/admin/update_organization_cleaner_spec.rb index 15fec17..074194d 100644 --- a/spec/commands/decidim/cleaner/admin/update_organization_cleaner_spec.rb +++ b/spec/commands/decidim/cleaner/admin/update_organization_cleaner_spec.rb @@ -53,7 +53,7 @@ module Decidim::Cleaner::Admin expect { command.call }.to broadcast(:ok) end - it "traces the update", versioning: true do + it "traces the update", :versioning do expect(Decidim.traceability) .to receive(:update!) .with(organization, user, a_kind_of(Hash)) diff --git a/spec/commands/decidim/destroy_account_spec.rb b/spec/commands/decidim/destroy_account_spec.rb index 9340693..79360d4 100644 --- a/spec/commands/decidim/destroy_account_spec.rb +++ b/spec/commands/decidim/destroy_account_spec.rb @@ -105,4 +105,4 @@ module Decidim end end end -end \ No newline at end of file +end diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index fb57ccd..0000000 --- a/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - -