<commit_before>class GiftCard < ActiveRecord::Base

  monetize :amount_cents

  enum reason: {
    unknown: 0,
    signup: 1,
    test: 2,
    referral: 3,
    interview: 4,
    other: 5
  }

  belongs_to :giftable, polymorphic: true, touch: true
  validates_presence_of :amount
  validates_presence_of :reason

  # Need to add validation to limit 1 signup per person

end<commit_msg>add format validation for expiration date<commit_after>class GiftCard < ActiveRecord::Base

  monetize :amount_cents

  enum reason: {
    unknown: 0,
    signup: 1,
    test: 2,
    referral: 3,
    interview: 4,
    other: 5
  }

  belongs_to :giftable, polymorphic: true, touch: true
  validates_presence_of :amount
  validates_presence_of :reason
  validates_format_of :expiration_date, with: /\A(0|1)([0-9])\/(2[0-9]{3})\z/i

  # Need to add validation to limit 1 signup per person

end
{'fraction_non_alphanumeric': 0.09371428571428571, 'fraction_numerical': 0.025142857142857144, 'mean_word_length': 3.5625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '201561', 'n_tokens_mistral': 335, 'n_tokens_neox': 304, 'n_words': 88}