From 81b73d5196e3b9ec7c989e55aa5a2205a033e71b Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Thu, 21 Jul 2022 21:22:23 +0200 Subject: [PATCH] Replace options hash with keyword arguments --- app/models/notification.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index 0d5f47d3..34c647ae 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -10,12 +10,12 @@ class Notification < ApplicationRecord define_cursor_paginator :cursored_for, :for define_cursor_paginator :cursored_for_type, :for_type - def for(recipient, options = {}) - where(options.merge!(recipient: recipient)).order(:created_at).reverse_order + def for(recipient, **kwargs) + where(kwargs.merge!(recipient: recipient)).order(:created_at).reverse_order end - def for_type(recipient, type, options = {}) - where(options.merge!(recipient: recipient)).where(type: type).order(:created_at).reverse_order + def for_type(recipient, type, **kwargs) + where(kwargs.merge!(recipient: recipient)).where(type: type).order(:created_at).reverse_order end def notify(recipient, target)