Merge pull request #5881 from betagouv/ruby-2.7-keyword-arguments

This commit is contained in:
Pierre de La Morinerie 2021-02-09 09:38:14 +01:00 committed by GitHub
commit 08a588614f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -792,9 +792,9 @@ GEM
xray-rails (0.3.2)
rails (>= 3.1.0)
zeitwerk (2.4.2)
zip_tricks (5.3.1)
zipline (1.2.1)
rails (>= 3.2.1, < 6.1)
zip_tricks (5.5.0)
zipline (1.3.0)
actionpack (>= 3.2.1, < 7.0)
zip_tricks (>= 4.2.1, < 6.0)
zxcvbn-ruby (1.1.0)

View file

@ -150,7 +150,7 @@ class DossierMailer < ApplicationMailer
if interpolations[:state]
mailer_scope = self.class.mailer_name.tr('/', '.')
state = interpolations[:state].in?(Dossier::TERMINE) ? 'termine' : interpolations[:state]
I18n.t("subject_#{state}", interpolations.merge(scope: [mailer_scope, action_name]))
I18n.t("subject_#{state}", **interpolations.merge(scope: [mailer_scope, action_name]))
else
super
end

View file

@ -227,8 +227,8 @@ class Dossier < ApplicationRecord
user: [])
}
scope :with_notifiable_procedure, -> (notify_on_closed: false) do
states = notify_on_closed ? [:publiee, :close, :depubliee] : [:publiee, :depubliee]
scope :with_notifiable_procedure, -> (opts = { notify_on_closed: false }) do
states = opts[:notify_on_closed] ? [:publiee, :close, :depubliee] : [:publiee, :depubliee]
joins(:procedure)
.where(procedures: { aasm_state: states })
end

View file

@ -71,7 +71,7 @@ module FeatureHelpers
# Add a new type de champ in the procedure editor
def add_champ(options = {})
add_champs(options)
add_champs(**options)
end
# Add several new type de champ in the procedure editor