Skip to content

Commit

Permalink
fix gift card type regex
Browse files Browse the repository at this point in the history
don't filter out certificate column in gift cards
  • Loading branch information
andrewroth committed Dec 12, 2024
1 parent c00f527 commit 41dbb42
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/gift_card_type.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class GiftCardType < ApplicationRecord
include HasNumbering

validates :numbering, presence: true, format: { with: /^[^x]*x+[^x]*$/ }
validates :numbering, presence: true, format: { with: /\A[^x]*x+[^x]*\z/ }

def to_s
label
Expand Down
2 changes: 1 addition & 1 deletion app/models/issuance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def largest_existing_number_in_certificate

# pulling all allocated certificate ids instead of a regex isn't ideal, but there shouldn't be many, if any, times there
# are previewed gift cards issuances while another one is being previewed
existing_matching_certificates += Issuance.preview.pluck(:allocated_certificates).collect do |allocated_certificates|
existing_matching_certificates += Issuance.previewing.pluck(:allocated_certificates).collect do |allocated_certificates|
allocated_certificates.split(CERTIFICATE_DISPLAY_SEPARATOR).find_all { |certificate| certificate =~ numbering_regex }
end.flatten

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
:passw, :email, :secret, :token, :_key, :crypt, :salt, :otp, :ssn
]
3 changes: 3 additions & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 41dbb42

Please sign in to comment.