Fix keyword args in random_locales_attributes calls

We were passing a hash when the method definition expected keyword
arguments, and so we were getting warnings in Ruby 2.7:

```
db/dev_seeds/widgets.rb:11: warning: Using the last argument as keyword
parameters is deprecated; maybe ** should be added to the call

db/dev_seeds/widgets.rb:23: warning: Using the last argument as keyword
parameters is deprecated; maybe ** should be added to the call

db/dev_seeds/widgets.rb:35: warning: Using the last argument as keyword
parameters is deprecated; maybe ** should be added to the call

db/dev_seeds/widgets.rb:47: warning: Using the last argument as keyword
parameters is deprecated; maybe ** should be added to the call

db/dev_seeds/admin_notifications.rb:3: warning: Using the last argument
as keyword parameters is deprecated; maybe ** should be added to the
call

db/dev_seeds/admin_notifications.rb:11: warning: Using the last argument
as keyword parameters is deprecated; maybe ** should be added to the
call

db/dev_seeds/admin_notifications.rb:19: warning: Using the last argument
as keyword parameters is deprecated; maybe ** should be added to the
call

db/dev_seeds/admin_notifications.rb:27: warning: Using the last argument
as keyword parameters is deprecated; maybe ** should be added to the
call
```

Converting the hash to keyword arguments solves the issue.
This commit is contained in:
Javi Martín
2022-09-08 23:02:57 +02:00
parent b341debdff
commit 023bc6eb59
2 changed files with 8 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
section "Creating Admin Notifications & Templates" do section "Creating Admin Notifications & Templates" do
AdminNotification.create!( AdminNotification.create!(
random_locales_attributes( random_locales_attributes(
%i[title body].index_with do |attribute| **%i[title body].index_with do |attribute|
-> { I18n.t("seeds.admin_notifications.proposal.#{attribute}") } -> { I18n.t("seeds.admin_notifications.proposal.#{attribute}") }
end end
).merge( ).merge(
@@ -12,7 +12,7 @@ section "Creating Admin Notifications & Templates" do
AdminNotification.create!( AdminNotification.create!(
random_locales_attributes( random_locales_attributes(
%i[title body].index_with do |attribute| **%i[title body].index_with do |attribute|
-> { I18n.t("seeds.admin_notifications.help.#{attribute}") } -> { I18n.t("seeds.admin_notifications.help.#{attribute}") }
end end
).merge(link: "https://crwd.in/consul", segment_recipient: "administrators") ).merge(link: "https://crwd.in/consul", segment_recipient: "administrators")
@@ -20,7 +20,7 @@ section "Creating Admin Notifications & Templates" do
AdminNotification.create!( AdminNotification.create!(
random_locales_attributes( random_locales_attributes(
%i[title body].index_with do |attribute| **%i[title body].index_with do |attribute|
-> { I18n.t("seeds.admin_notifications.map.#{attribute}") } -> { I18n.t("seeds.admin_notifications.map.#{attribute}") }
end end
).merge(segment_recipient: "administrators") ).merge(segment_recipient: "administrators")
@@ -28,7 +28,7 @@ section "Creating Admin Notifications & Templates" do
AdminNotification.create!( AdminNotification.create!(
random_locales_attributes( random_locales_attributes(
%i[title body].index_with do |attribute| **%i[title body].index_with do |attribute|
-> { I18n.t("seeds.admin_notifications.budget.#{attribute}") } -> { I18n.t("seeds.admin_notifications.budget.#{attribute}") }
end end
).merge(segment_recipient: "administrators", sent_at: nil) ).merge(segment_recipient: "administrators", sent_at: nil)

View File

@@ -9,7 +9,7 @@ section "Creating header and cards for the homepage" do
Widget::Card.create!( Widget::Card.create!(
random_locales_attributes( random_locales_attributes(
%i[title description link_text label].index_with do |attribute| **%i[title description link_text label].index_with do |attribute|
-> { I18n.t("seeds.cards.header.#{attribute}") } -> { I18n.t("seeds.cards.header.#{attribute}") }
end end
).merge( ).merge(
@@ -21,7 +21,7 @@ section "Creating header and cards for the homepage" do
Widget::Card.create!( Widget::Card.create!(
random_locales_attributes( random_locales_attributes(
%i[title description link_text label].index_with do |attribute| **%i[title description link_text label].index_with do |attribute|
-> { I18n.t("seeds.cards.debate.#{attribute}") } -> { I18n.t("seeds.cards.debate.#{attribute}") }
end end
).merge( ).merge(
@@ -33,7 +33,7 @@ section "Creating header and cards for the homepage" do
Widget::Card.create!( Widget::Card.create!(
random_locales_attributes( random_locales_attributes(
%i[title description link_text label].index_with do |attribute| **%i[title description link_text label].index_with do |attribute|
-> { I18n.t("seeds.cards.proposal.#{attribute}") } -> { I18n.t("seeds.cards.proposal.#{attribute}") }
end end
).merge( ).merge(
@@ -45,7 +45,7 @@ section "Creating header and cards for the homepage" do
Widget::Card.create!( Widget::Card.create!(
random_locales_attributes( random_locales_attributes(
%i[title description link_text label].index_with do |attribute| **%i[title description link_text label].index_with do |attribute|
-> { I18n.t("seeds.cards.budget.#{attribute}") } -> { I18n.t("seeds.cards.budget.#{attribute}") }
end end
).merge( ).merge(