mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
Fix Style/HashSyntax
This commit is contained in:
@@ -10,8 +10,8 @@ module Addressing
|
||||
address1: parts[0],
|
||||
city: parts[1],
|
||||
zipcode: parts[2],
|
||||
state: state,
|
||||
country: country
|
||||
state:,
|
||||
country:
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user