Sha256: eb5d35891baa2e319f93cc46bce1e8cb3407e837d1be3af9191f520728474606
Contents?: true
Size: 842 Bytes
Versions: 23
Compression:
Stored size: 842 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 }) index({ discount_id: 1, created_at: -1 }, { background: true }) before_validation :downcase_email private def downcase_email self.email = email.downcase if email.present? end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems