From 30767fa44e79a57bc4e448b089cf099f603aa085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 19 Jul 2023 16:50:48 +0200 Subject: [PATCH] Use Ruby 1.9 hash notation in assignment scopes --- app/models/poll/officer_assignment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/poll/officer_assignment.rb b/app/models/poll/officer_assignment.rb index 19aae0efb..ffe4747b4 100644 --- a/app/models/poll/officer_assignment.rb +++ b/app/models/poll/officer_assignment.rb @@ -19,8 +19,8 @@ class Poll where("officer_id = ? AND poll_booth_assignments.poll_id = ?", officer_id, poll_id) end scope :by_officer, ->(officer) { where(officer_id: officer.id) } - scope :by_poll, ->(poll) { joins(:booth_assignment).where("poll_booth_assignments.poll_id" => poll.id) } - scope :by_booth, ->(booth) { joins(:booth_assignment).where("poll_booth_assignments.booth_id" => booth.id) } + scope :by_poll, ->(poll) { joins(:booth_assignment).where("poll_booth_assignments.poll_id": poll.id) } + scope :by_booth, ->(booth) { joins(:booth_assignment).where("poll_booth_assignments.booth_id": booth.id) } scope :by_date, ->(date) { where(date: date) } before_create :log_user_data