Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
stringifying keys for lane_details (#352)
Browse files Browse the repository at this point in the history
* stringifying keys for lane_details

* changed stringify_keys to explicitly defining keys as strings
  • Loading branch information
dunkOnIT authored Nov 28, 2023
1 parent 212da88 commit ad610a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions app/helpers/lane_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def self.competing_lane(event_ids: [], comment: '', guests: 0, admin_comment: ''
competing_lane.completed_steps = ['Event Registration']
competing_lane.lane_state = registration_status
competing_lane.lane_details = {
event_details: event_ids.map { |event_id| { event_id: event_id, event_registration_state: registration_status } },
comment: comment,
admin_comment: admin_comment,
guests: guests,
'event_details' => event_ids.map { |event_id| { event_id: event_id, event_registration_state: registration_status } },
'comment' => comment,
'admin_comment' => admin_comment,
'guests' => guests,
}
competing_lane
end
Expand All @@ -22,11 +22,11 @@ def self.payment_lane(fee_lowest_denominator, currency_code, payment_id)
payment_lane.completed_steps = ['Payment Intent Init']
payment_lane.lane_state = 'initialized'
payment_lane.lane_details = {
amount_lowest_denominator: fee_lowest_denominator,
payment_id: payment_id,
currency_code: currency_code,
last_updated: Time.now,
payment_history: [],
'amount_lowest_denominator' => fee_lowest_denominator,
'payment_id' => payment_id,
'currency_code' => currency_code,
'last_updated' => Time.now,
'payment_history' => [],
}
payment_lane
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def update_competing_lane!(update_params)
if update_params[:status].present?
lane.lane_state = update_params[:status]

lane.lane_details[:event_details].each do |event|
lane.lane_details['event_details'].each do |event|
# NOTE: Currently event_registration_state is not used - when per-event registrations are added, we need to add validation logic to support cases like
# limited registrations and waiting lists for certain events
event['event_registration_state'] = update_params[:status]
Expand Down

0 comments on commit ad610a4

Please sign in to comment.