diff --git a/.rubocop.yml b/.rubocop.yml index 66763e9ea..1e882cfd8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -93,9 +93,6 @@ Rails/SaveBang: Rails/SkipsModelValidations: Enabled: true -Rails/UniqBeforePluck: - Enabled: true - RSpec/AlignLeftLetBrace: Enabled: false diff --git a/app/controllers/concerns/moderate_actions.rb b/app/controllers/concerns/moderate_actions.rb index f8c2b96c8..52e0a02cf 100644 --- a/app/controllers/concerns/moderate_actions.rb +++ b/app/controllers/concerns/moderate_actions.rb @@ -25,7 +25,7 @@ module ModerateActions @resources.accessible_by(current_ability, :ignore_flag).each(&:ignore_flag) elsif params[:block_authors].present? - author_ids = @resources.pluck(author_id).uniq + author_ids = @resources.pluck(author_id) User.where(id: author_ids).accessible_by(current_ability, :block).each { |user| block_user user } end diff --git a/app/controllers/tracking/budget_investments_controller.rb b/app/controllers/tracking/budget_investments_controller.rb index 4586b7308..83a4f28d0 100644 --- a/app/controllers/tracking/budget_investments_controller.rb +++ b/app/controllers/tracking/budget_investments_controller.rb @@ -48,7 +48,7 @@ class Tracking::BudgetInvestmentsController < Tracking::BaseController def heading_filters investments = @budget.investments.by_tracker(current_user.tracker&.id).distinct - investment_headings = Budget::Heading.where(id: investments.pluck(:heading_id).uniq) + investment_headings = Budget::Heading.where(id: investments.pluck(:heading_id)) .order(name: :asc) all_headings_filter = [ { diff --git a/lib/user_segments.rb b/lib/user_segments.rb index 17d609e68..d6bd427fb 100644 --- a/lib/user_segments.rb +++ b/lib/user_segments.rb @@ -18,29 +18,29 @@ class UserSegments end def self.all_proposal_authors - author_ids(Proposal.pluck(:author_id).uniq) + author_ids(Proposal.pluck(:author_id)) end def self.proposal_authors - author_ids(Proposal.not_archived.not_retired.pluck(:author_id).uniq) + author_ids(Proposal.not_archived.not_retired.pluck(:author_id)) end def self.investment_authors - author_ids(current_budget_investments.pluck(:author_id).uniq) + author_ids(current_budget_investments.pluck(:author_id)) end def self.feasible_and_undecided_investment_authors unfeasible_and_finished_condition = "feasibility = 'unfeasible' and valuation_finished = true" investments = current_budget_investments.where.not(unfeasible_and_finished_condition) - author_ids(investments.pluck(:author_id).uniq) + author_ids(investments.pluck(:author_id)) end def self.selected_investment_authors - author_ids(current_budget_investments.selected.pluck(:author_id).uniq) + author_ids(current_budget_investments.selected.pluck(:author_id)) end def self.winner_investment_authors - author_ids(current_budget_investments.winners.pluck(:author_id).uniq) + author_ids(current_budget_investments.winners.pluck(:author_id)) end def self.not_supported_on_current_budget