Sha256: 6e8389d62e27d46319b6e1f43360ed829f6ceb0b0874ca9ab4fdb7d27b3a85f9
Contents?: true
Size: 770 Bytes
Versions: 11
Compression:
Stored size: 770 Bytes
Contents
module Workarea module Pricing class Discount # Represents an instance of redemption for a {Discount}. # Used for calculating single use discounts. # class Redemption include ApplicationDocument # @!attribute email # @return [String] the email that received the discount # field :email, type: String # @!attribute discount # @return [Discount] the discount # belongs_to :discount, class_name: 'Workarea::Pricing::Discount' index({ discount_id: 1, email: 1 }) before_validation :downcase_email private def downcase_email self.email = email.downcase if email.present? end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems