Replace options hash with keyword arguments
This commit is contained in:
parent
7b831875b0
commit
81b73d5196
|
@ -10,12 +10,12 @@ class Notification < ApplicationRecord
|
||||||
define_cursor_paginator :cursored_for, :for
|
define_cursor_paginator :cursored_for, :for
|
||||||
define_cursor_paginator :cursored_for_type, :for_type
|
define_cursor_paginator :cursored_for_type, :for_type
|
||||||
|
|
||||||
def for(recipient, options = {})
|
def for(recipient, **kwargs)
|
||||||
where(options.merge!(recipient: recipient)).order(:created_at).reverse_order
|
where(kwargs.merge!(recipient: recipient)).order(:created_at).reverse_order
|
||||||
end
|
end
|
||||||
|
|
||||||
def for_type(recipient, type, options = {})
|
def for_type(recipient, type, **kwargs)
|
||||||
where(options.merge!(recipient: recipient)).where(type: type).order(:created_at).reverse_order
|
where(kwargs.merge!(recipient: recipient)).where(type: type).order(:created_at).reverse_order
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify(recipient, target)
|
def notify(recipient, target)
|
||||||
|
|
Loading…
Reference in New Issue