From d0a2c0cf662e4dca74e1a9c6dfb3d46d5450a1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 2 Apr 2024 16:32:53 +0200 Subject: [PATCH] Use -> instead of lambda in dashboard action scopes Since we've changed these scopes in the previous commit because of the new rubocop version, we're also making them consistent with the other scopes in the same file. --- app/models/dashboard/action.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/dashboard/action.rb b/app/models/dashboard/action.rb index 159e3d91b..fe29b3649 100644 --- a/app/models/dashboard/action.rb +++ b/app/models/dashboard/action.rb @@ -33,12 +33,8 @@ class Dashboard::Action < ApplicationRecord scope :inactive, -> { where(active: false) } scope :resources, -> { where(action_type: 1) } scope :proposed_actions, -> { where(action_type: 0) } - scope :by_proposal, lambda { |proposal| - where(published_proposal: false) if proposal.draft? - } - scope :by_published_proposal, lambda { |published| - where(published_proposal: published) - } + scope :by_proposal, ->(proposal) { where(published_proposal: false) if proposal.draft? } + scope :by_published_proposal, ->(published) { where(published_proposal: published) } def self.active_for(proposal) published_at = proposal.published_at&.to_date || Date.current