Fix Style/HashSyntax

This commit is contained in:
Neal Chambers
2023-09-16 09:05:31 +09:00
parent 0b4d0a1438
commit 4596997547
30 changed files with 56 additions and 56 deletions

View File

@@ -10,8 +10,8 @@ module Addressing
address1: parts[0],
city: parts[1],
zipcode: parts[2],
state: state,
country: country
state:,
country:
)
end

View File

@@ -14,7 +14,7 @@ module SampleData
name = data[:name]
log "- #{name}"
data[:long_description] = data[:long_description].strip_heredoc.tr("\n", " ")
Enterprise.create_with(data).find_or_create_by!(name: name)
Enterprise.create_with(data).find_or_create_by!(name:)
end
end

View File

@@ -52,7 +52,7 @@ module SampleData
def create_order_cycle(name, coordinator_name, supplier_names, distributor_names, data)
coordinator = Enterprise.find_by(name: coordinator_name)
return if OrderCycle.active.where(name: name).exists?
return if OrderCycle.active.where(name:).exists?
log "- #{name}"
cycle = create_order_cycle_with_fee(name, coordinator)
@@ -61,10 +61,10 @@ module SampleData
def create_order_cycle_with_fee(name, coordinator)
cycle = OrderCycle.create!(
name: name,
name:,
orders_open_at: 1.day.ago,
orders_close_at: 1.month.from_now,
coordinator: coordinator
coordinator:
)
cycle.coordinator_fees << coordinator.enterprise_fees.first
cycle

View File

@@ -48,8 +48,8 @@ module SampleData
def create_payment_method(provider_class, enterprise, name, description, calculator)
payment_method = provider_class.new(
name: name,
description: description,
name:,
description:,
environment: Rails.env,
distributor_ids: [enterprise.id]
)

View File

@@ -33,11 +33,11 @@ module SampleData
password = Spree::User.friendly_token
log "- #{email}"
user = Spree::User.create_with(
password: password,
password:,
password_confirmation: password,
confirmation_sent_at: Time.zone.now,
confirmed_at: Time.zone.now
).find_or_create_by!(email: email)
).find_or_create_by!(email:)
[name, user]
end
end