Commit Graph

20028 Commits

Author SHA1 Message Date
Javi Martín
21ca96ae1c Fix conflictive debates with no votes
We originally added the `cached_votes_up > 0` in commit 4ce95e273
because back then `cached_votes_up` was used in the denominator. That's
no longer the case, and it doesn't make sense to mark a debate with 1
vote and 10 flags as conflictive but not doing it when the debate has no
votes and 1000 flags.

We're fixing the bug right now because we're about to change the
affected line in order to apply a new rubocop rule.
2023-09-07 19:08:36 +02:00
Javi Martín
e2542eed22 Merge pull request #5105 from consuldemocracy/rotate_logger
Rotate logs on production
2023-09-07 16:31:29 +02:00
Javi Martín
e077c7e890 Rotate log files on production and staging
The code based on the logger Rails uses by default; as mentioned in the
Rails configuration guide:

> [the logger] defaults to an instance of ActiveSupport::TaggedLogging
> that wraps an instance of ActiveSupport::Logger which outputs a log to
> the log/ directory. You can supply a custom logger, to get full
> compatibility you must follow these guidelines:
>
> * To support a formatter, you must manually assign a formatter from
>   the config.log_formatter value to the logger.
> * To support tagged logs, the log instance must be wrapped with
>   ActiveSupport::TaggedLogging.
> * To support silencing, the logger must include
>   ActiveSupport::LoggerSilence module. The ActiveSupport::Logger class
>   already includes these modules.
2023-09-07 15:58:16 +02:00
Javi Martín
11b962da8f Add and apply Style/MinMaxComparison rubocop rule
This rule was added in rubocop 1.42.0.
2023-09-07 13:09:11 +02:00
Javi Martín
daa35845da Add and apply Style/RedundantStringEscape rule
This rule was added in rubocop 1.37.0. It's particularly useful in the
background image spec, since now there's one less backslash to decipher
when reading the code :).
2023-09-07 13:09:11 +02:00
dependabot[bot]
ff04009e4a Bump rubocop from 1.35.1 to 1.56.2
Among many things, this version includes updates in the
`Layout/ExtraSpacing`, `Layout/SpaceAroundOperators` and
`Style/RedundantReturn` rules, which means we need to update the code in
some places in order to follow these rules.

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.35.1 to 1.56.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.35.1...v1.56.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 13:09:11 +02:00
Javi Martín
c3d666ddce Merge pull request #5188 from consuldemocracy/dependabot/bundler/rubocop-rspec-2.17.1
Bump rubocop-rspec from 2.4.0 to 2.17.1
2023-09-07 13:08:22 +02:00
Javi Martín
d729e6c05d Merge pull request #5221 from consuldemocracy/dependabot/bundler/rubocop-rails-2.20.2
Bump rubocop-rails from 2.15.2 to 2.20.2
2023-09-07 13:00:24 +02:00
Javi Martín
a796e450b7 Add RSpec/Capybara/SpecificActions rubocop rule
This rule was added in rubocop-rspec 2.14.0. Even though we always
follow this rule, we haven't always done so in the past. Now we're
making sure we'll keep following this rule.
2023-09-06 19:00:56 +02:00
Javi Martín
05757c7f02 Add and apply RSpec/Rails/InferredSpecType rule
This rule was added in rubocop-rspec 2.14.0.
2023-09-06 19:00:56 +02:00
Javi Martín
8e276e2891 Add FactoryBot/ConsistentParenthesesStyle rule
This rule was added in rubocop-rspec 2.14.0. We were already applying it
most of the time.
2023-09-06 19:00:56 +02:00
Javi Martín
2d4ff86837 Add and apply Capybara/NegationMatcher rubocop rule
This rule was added in rubocop-rspec 2.14.0. We were already following
it most of the time.
2023-09-06 19:00:56 +02:00
Javi Martín
c4e32ea528 Add and apply HaveHttpStatus rubocop rule
This rule was added in rubocop-rspec 2.12.0. We were already applying it
most of the time.
2023-09-06 19:00:56 +02:00
Javi Martín
f52a86b465 Apply (but don't add) Capybara/SpecificMatcher rule
This rule was added in rubocop-rspec 2.12.0, and we were already
following it most of the time.

However, the rule isn't working correctly in some cases, such as input
selectors, so we aren't enabling it.
2023-09-06 19:00:56 +02:00
Javi Martín
c2010f9756 Apply (but don't add) ChangeByZero rubocop rule
This rule was added in rubocop-rspec 2.11.0. We aren't adding it
because, out of 3 offenses, this cop can only correct 2 automatically.
Not sure how to correct the other one since it uses `.and change`.
2023-09-06 19:00:56 +02:00
Javi Martín
f79a21f071 Add and apply RSpec/BeEq rubocop rule
This rule was added in rubocop-rspec 2.9.0. Once again, we were applying
it about 50% of the time.
2023-09-06 19:00:56 +02:00
Javi Martín
6268ae9274 Add and apply RSpec/BeNil rubocop rule
This rule was added in rubocop-rspec 2.9.0.

We were using `be_nil` 50% of the time, and `be nil` the rest of the
time. No strong preference for either one, but IMHO we don't lose
anything be being consistent.
2023-09-06 19:00:56 +02:00
Javi Martín
4fc4afa3a7 Add RSpec/ExcessiveDocstringSpacing rubocop rule
This rule was added in rubocop-rspec 2.5.0.
2023-09-06 19:00:56 +02:00
dependabot[bot]
a12cf85423 Bump rubocop-rspec from 2.4.0 to 2.17.1
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.4.0 to 2.17.1.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v2.4.0...v2.17.1)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 19:00:56 +02:00
Javi Martín
2951d0fdf8 Add and apply Rails/ResponseParsedBody rubocop rule
This rule was introduced in rubocop-rails 2.18.0.

Since using `response.parsed_body` is shorter than using
`JSON.parse(response.body)`, this also means we can group some lines in
one.
2023-09-06 19:00:39 +02:00
Javi Martín
cb32d19f5e Add Rails/WhereNotWithMultipleConditions rule
This rule was introduced in rubocop-rails 2.17.0.

We don't use `where.not` with multiple conditions anywhere, but if we
did, it would indeed be very confusing, so we're adding a rule to avoid
that scenario.
2023-09-06 19:00:39 +02:00
Javi Martín
58a9e6c76e Add Rails/ActionControllerFlashBeforeRender rule
This rule was added in rubocop-rails 2.16.0. Even if we always follow
it, sometimes developers don't realize about this mistake immediately,
so it's good to have a rule to guarantee it won't happen.
2023-09-06 19:00:36 +02:00
dependabot[bot]
700ec6d0c0 Bump rubocop-rails from 2.15.2 to 2.20.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.15.2 to 2.20.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.15.2...v2.20.2)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 14:54:21 +02:00
Javi Martín
b23ea25367 Apply Performance/CompareWithBlock rule to sort!
We should have applied this change in commit a78a8d592, since it was
added in rubocop-performance 1.18.0, but forgot to do so.
2023-09-06 14:54:21 +02:00
Javi Martín
7433c6b91e Merge pull request #5236 from consuldemocracy/revert_pg-1.5.4
Revert "Bump pg from 1.4.3 to 1.5.4"
2023-09-06 13:43:48 +02:00
Javi Martín
302d35ac47 Revert "Bump pg from 1.4.3 to 1.5.4"
We were getting warnings due to an incompatibility between pg 1.5.x and
Active Record. I thought it was fixed in Active Record 6.1.x, but it
isn't, so we're using pg 1.4.x until we upgrade to Rails 7.

The warning was:

```
PG::Coder.new(hash) is deprecated. Please use keyword arguments instead!
Called from
activerecord-6.0.6.1/lib/active_record/connection_adapters/postgresql_adapter.rb:883:in
`new'
```

This reverts commit c03f4243f.
2023-09-06 13:21:32 +02:00
Javi Martín
6821a59758 Merge pull request #5214 from consuldemocracy/dependabot/bundler/knapsack_pro-5.6.0
Bump knapsack_pro from 3.3.1 to 5.6.0
2023-09-06 13:18:14 +02:00
dependabot[bot]
dc1e0209ac Bump knapsack_pro from 3.3.1 to 5.6.0
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 3.3.1 to 5.6.0.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.3.1...v5.6.0)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 12:58:12 +02:00
Javi Martín
10e06aee89 Merge pull request #5203 from consuldemocracy/dependabot/bundler/ahoy_matey-4.2.1
Bump ahoy_matey from 4.1.0 to 4.2.1
2023-09-05 15:41:09 +02:00
dependabot[bot]
d8f8a94a26 Bump ahoy_matey from 4.1.0 to 4.2.1
Bumps [ahoy_matey](https://github.com/ankane/ahoy) from 4.1.0 to 4.2.1.
- [Changelog](https://github.com/ankane/ahoy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/ahoy/compare/v4.1.0...v4.2.1)

---
updated-dependencies:
- dependency-name: ahoy_matey
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 13:18:37 +00:00
Javi Martín
c956c64913 Merge pull request #5223 from consuldemocracy/dependabot/bundler/sprockets-4.2.0
Bump sprockets from 4.1.1 to 4.2.0
2023-09-05 15:16:55 +02:00
Senén Rodero Rodríguez
d0fb228f96 Make model concerns customization easier 2023-09-05 14:55:06 +02:00
dependabot[bot]
c0823a468c Bump sprockets from 4.1.1 to 4.2.0
Bumps [sprockets](https://github.com/rails/sprockets) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/rails/sprockets/releases)
- [Changelog](https://github.com/rails/sprockets/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/sprockets/compare/v4.1.1...v4.2.0)

---
updated-dependencies:
- dependency-name: sprockets
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 12:53:50 +00:00
Javi Martín
437985cccf Merge pull request #5199 from consuldemocracy/dependabot/bundler/view_component-3.5.0
Bump view_component from 2.78.0 to 3.5.0
2023-09-05 14:40:07 +02:00
dependabot[bot]
af0128860f Bump view_component from 2.78.0 to 3.5.0
Note version 3.0 removed the `controller` and `request` methods used in
component tests, introducing `vc_test_controller` and `vc_test_request`
instead.

Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.78.0 to 3.5.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.78.0...v3.5.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 14:17:36 +02:00
Javi Martín
41d44aa7f1 Merge pull request #5211 from consuldemocracy/dependabot/bundler/omniauth-google-oauth2-1.1.1
Bump omniauth-google-oauth2 from 1.0.1 to 1.1.1
2023-09-05 13:19:15 +02:00
dependabot[bot]
da6cbf006e Bump omniauth-google-oauth2 from 1.0.1 to 1.1.1
Dependabot couldn't find the original pull request head commit, b0a9e5f379b70bac8ebe312131914b55f5f859e2.
2023-09-05 10:47:15 +00:00
Javi Martín
a097b5a366 Merge pull request #5206 from consuldemocracy/dependabot/bundler/faker-3.2.1
Bump faker from 2.22.0 to 3.2.1
2023-09-05 11:55:28 +02:00
dependabot[bot]
7dd35efbd1 Bump faker from 2.22.0 to 3.2.1
Bumps [faker](https://github.com/faker-ruby/faker) from 2.22.0 to 3.2.1.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/faker-ruby/faker/compare/v2.22.0...v3.2.1)

---
updated-dependencies:
- dependency-name: faker
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 17:32:34 +00:00
Javi Martín
49c3cb91ad Merge pull request #5194 from consuldemocracy/dependabot/bundler/rubocop-performance-1.19.0
Bump rubocop-performance from 1.14.3 to 1.19.0
2023-09-04 17:23:30 +02:00
dependabot[bot]
a78a8d592b Bump rubocop-performance from 1.14.3 to 1.19.0
Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.14.3 to 1.19.0.
- [Release notes](https://github.com/rubocop/rubocop-performance/releases)
- [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.14.3...v1.19.0)

---
updated-dependencies:
- dependency-name: rubocop-performance
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 14:59:35 +00:00
Javi Martín
24553ac626 Merge pull request #5230 from consuldemocracy/dependabot/bundler/pg-1.5.4
Bump pg from 1.4.3 to 1.5.4
2023-09-04 16:57:23 +02:00
Javi Martín
a685bf405c Merge pull request #5231 from consuldemocracy/fix_code_climate
Update Rubocop version used in Code Climate
2023-09-04 15:41:17 +02:00
Javi Martín
e3a93ac083 Update Rubocop version used in Code Climate
Rubocop 0.74 doesn't work with Ruby 3.x, and so the Code Climate report
was failing.
2023-09-03 22:16:37 +02:00
dependabot[bot]
c03f4243ff Bump pg from 1.4.3 to 1.5.4
Bumps [pg](https://github.com/ged/ruby-pg) from 1.4.3 to 1.5.4.
- [Changelog](https://github.com/ged/ruby-pg/blob/master/History.md)
- [Commits](https://github.com/ged/ruby-pg/compare/v1.4.3...v1.5.4)

---
updated-dependencies:
- dependency-name: pg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 15:53:53 +00:00
Javi Martín
d1c3810042 Merge pull request #5222 from consuldemocracy/dependabot/bundler/wicked_pdf-2.7.0
Bump wicked_pdf from 2.6.3 to 2.7.0
2023-09-01 17:51:52 +02:00
dependabot[bot]
ca36e996e1 Bump wicked_pdf from 2.6.3 to 2.7.0
Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/mileszs/wicked_pdf/releases)
- [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mileszs/wicked_pdf/commits)

---
updated-dependencies:
- dependency-name: wicked_pdf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 15:25:11 +00:00
Javi Martín
0ef192d14f Merge pull request #5212 from consuldemocracy/dependabot/bundler/email_spec-2.2.2
Bump email_spec from 2.2.0 to 2.2.2
2023-09-01 17:23:57 +02:00
dependabot[bot]
0aca4ea4ad Bump email_spec from 2.2.0 to 2.2.2
Bumps [email_spec](https://github.com/email-spec/email-spec) from 2.2.0 to 2.2.2.
- [Changelog](https://github.com/email-spec/email-spec/blob/main/Changelog.md)
- [Commits](https://github.com/email-spec/email-spec/compare/v2.2.0...v2.2.2)

---
updated-dependencies:
- dependency-name: email_spec
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 14:41:40 +00:00
Javi Martín
028a874bb2 Merge pull request #5210 from consuldemocracy/dependabot/bundler/pronto-rubocop-0.11.5
Bump pronto-rubocop from 0.11.2 to 0.11.5
2023-09-01 16:40:01 +02:00