Skip to content

Commit

Permalink
Re-add and apply Rails/UniqBeforePluck rule
Browse files Browse the repository at this point in the history
We removed it in commit d639cd5 because it recommended using `uniq`
where `distinct` was more appropriate. This has been fixed in
rubocop-rails 2.6.0.
  • Loading branch information
javierm committed Oct 26, 2020
1 parent d7e6a5c commit 4658e18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ Rails/SkipsModelValidations:
Rails/TimeZone:
Enabled: true

Rails/UniqBeforePluck:
Enabled: true

Rails/UniqueValidationWithoutIndex:
Enabled: true
Severity: refactor
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/stats_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Admin::StatsController < Admin::BaseController
def show
@event_types = Ahoy::Event.pluck(:name).uniq.sort
@event_types = Ahoy::Event.distinct.order(:name).pluck(:name)

@visits = Visit.count
@debates = Debate.with_hidden.count
Expand Down

0 comments on commit 4658e18

Please sign in to comment.