Skip to content

Commit

Permalink
validate currency
Browse files Browse the repository at this point in the history
  • Loading branch information
Edge7481 committed Apr 8, 2024
1 parent cbfb12b commit c06bfd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/ticket_purchase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TicketPurchase < ApplicationRecord
belongs_to :conference
belongs_to :payment

validates :ticket_id, :user_id, :conference_id, :quantity, presence: true
validates :ticket_id, :user_id, :conference_id, :quantity, :currency, presence: true
validate :one_registration_ticket_per_user
validate :registration_ticket_already_purchased, on: :create
validates :quantity, numericality: { greater_than: 0 }
Expand Down
2 changes: 1 addition & 1 deletion app/views/tickets/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%strong
= @conference.title
.col-md-4.text-right
- if ENV['SHOW_CURRENCY_SELECTOR'] == 'true'
- if true
.form-group
%label{for: 'currency_selector'} Currency:
= select_tag :currency, options_for_select(@currencies), id: 'currency_selector', class: 'form-control', style: 'width: auto; display: inline-block;'
Expand Down

0 comments on commit c06bfd7

Please sign in to comment.