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:
@@ -1,7 +1,7 @@
|
||||
section "Creating Admin Notifications & Templates" do
|
||||
AdminNotification.create!(
|
||||
random_locales_attributes(
|
||||
%i[title body].index_with do |attribute|
|
||||
**%i[title body].index_with do |attribute|
|
||||
-> { I18n.t("seeds.admin_notifications.proposal.#{attribute}") }
|
||||
end
|
||||
).merge(
|
||||
@@ -12,7 +12,7 @@ section "Creating Admin Notifications & Templates" do
|
||||
|
||||
AdminNotification.create!(
|
||||
random_locales_attributes(
|
||||
%i[title body].index_with do |attribute|
|
||||
**%i[title body].index_with do |attribute|
|
||||
-> { I18n.t("seeds.admin_notifications.help.#{attribute}") }
|
||||
end
|
||||
).merge(link: "https://crwd.in/consul", segment_recipient: "administrators")
|
||||
@@ -20,7 +20,7 @@ section "Creating Admin Notifications & Templates" do
|
||||
|
||||
AdminNotification.create!(
|
||||
random_locales_attributes(
|
||||
%i[title body].index_with do |attribute|
|
||||
**%i[title body].index_with do |attribute|
|
||||
-> { I18n.t("seeds.admin_notifications.map.#{attribute}") }
|
||||
end
|
||||
).merge(segment_recipient: "administrators")
|
||||
@@ -28,7 +28,7 @@ section "Creating Admin Notifications & Templates" do
|
||||
|
||||
AdminNotification.create!(
|
||||
random_locales_attributes(
|
||||
%i[title body].index_with do |attribute|
|
||||
**%i[title body].index_with do |attribute|
|
||||
-> { I18n.t("seeds.admin_notifications.budget.#{attribute}") }
|
||||
end
|
||||
).merge(segment_recipient: "administrators", sent_at: nil)
|
||||
|
||||
@@ -9,7 +9,7 @@ section "Creating header and cards for the homepage" do
|
||||
|
||||
Widget::Card.create!(
|
||||
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}") }
|
||||
end
|
||||
).merge(
|
||||
@@ -21,7 +21,7 @@ section "Creating header and cards for the homepage" do
|
||||
|
||||
Widget::Card.create!(
|
||||
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}") }
|
||||
end
|
||||
).merge(
|
||||
@@ -33,7 +33,7 @@ section "Creating header and cards for the homepage" do
|
||||
|
||||
Widget::Card.create!(
|
||||
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}") }
|
||||
end
|
||||
).merge(
|
||||
@@ -45,7 +45,7 @@ section "Creating header and cards for the homepage" do
|
||||
|
||||
Widget::Card.create!(
|
||||
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}") }
|
||||
end
|
||||
).merge(
|
||||
|
||||
Reference in New Issue
Block a user