Commit Graph

16 Commits

Author SHA1 Message Date
dependabot[bot]
21d39bac62 Bump rubocop-rails from 2.20.2 to 2.21.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.20.2 to 2.21.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.20.2...v2.21.2)

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

Note version 2.21.0 relaxes the default `Include` path for
`Rails/FindEach`, and so this version can find and correct offenses
outside the `app/models/` folder [1].

Also note this version replaces `unless something.include?` with `if
something.exclude?`; since we don't use the `exclude?` method anywhere,
we're removing the `include?` method from the list of methods checked by
this cop.

Finally, the Rails/HttpStatus method now returns a false positive when
rendering a dashboard partial and passing the `status` variable. In
order to avoid this issue, we could change the name of the local
variable or move the partial to a component, but for now we're simply
excluding these files for this cop.

[1] https://github.com/rubocop/rubocop-rails/pull/1059/commits/0066b3505

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 14:22:09 +01:00
Javi Martín
d0d681a44b Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when
a method starts with a `return` statement.

In other cases, we probably shouldn't have a guard rule in the middle of
a method in any case, but that's a different refactoring.
2019-10-24 17:56:03 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Senén Rodero Rodríguez
458fb750eb Fix restore method for paranoid models
Do not try to update confirmed_hide_at column from models without this column.
2019-06-27 09:19:35 +02:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
d7b8777395 Fix all Layout/SpaceAroundEqualsInParameterDefault rubocop issues from rubocop_todo list 2017-06-26 18:03:40 +02:00
Bertocq
db97314f7b Fix Lint/NestedMethodDefinition rubocop issue and remove it from rubocop_todo list 2017-06-19 10:45:18 +02:00
kikito
f0b8cfd4a2 Time.now -> Time.current 2016-11-23 19:19:19 +01:00
kikito
8ff8a1df7f Makes tags count only visible debates and proposals 2015-09-17 16:54:10 +02:00
David Gil
8ed434cc8b uses more rails-like syntax in scopes 2015-09-10 18:44:33 +02:00
Juanjo Bazán
29ebff615c adds method to paranoia for unconfirmed hides 2015-09-06 21:04:21 +02:00
kikito
fb9d3097cc Finishes admin interface for debates 2015-08-27 19:05:27 +02:00
Juanjo Bazán
5d112ac2bf adds after_hide hook to paranoid aliases 2015-08-26 17:24:11 +02:00
Juanjo Bazán
b340d7741a adds hiding users by moderators 2015-08-20 13:16:37 +02:00
rgarcia
fa6fa39cb6 removes unused method [#136] 2015-08-17 13:55:27 +02:00
rgarcia
f31ed2940d adds moderation to comments and debates [#136] 2015-08-17 13:39:31 +02:00