mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
12 lines
256 B
Ruby
12 lines
256 B
Ruby
class Promotion < ApplicationRecord
|
|
belongs_to :user
|
|
belongs_to :page_unlock_promo_code
|
|
|
|
# belongs_to :promo_code, polymorphic: true
|
|
def promo_code
|
|
page_unlock_promo_code
|
|
end
|
|
|
|
scope :active, -> { where('expires_at > ?', DateTime.now) }
|
|
end
|