Class: ReferralBox::Transaction
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ReferralBox::Transaction
- Defined in:
- lib/referral_box/models/transaction.rb
Instance Method Summary collapse
Instance Method Details
#active? ⇒ Boolean
23 24 25 |
# File 'lib/referral_box/models/transaction.rb', line 23 def active? !expired? end |
#adjusted? ⇒ Boolean
35 36 37 |
# File 'lib/referral_box/models/transaction.rb', line 35 def adjusted? transaction_type == "adjust" end |
#earned? ⇒ Boolean
27 28 29 |
# File 'lib/referral_box/models/transaction.rb', line 27 def earned? transaction_type == "earn" end |
#expired? ⇒ Boolean
19 20 21 |
# File 'lib/referral_box/models/transaction.rb', line 19 def expired? expires_at.present? && expires_at <= Time.current end |
#redeemed? ⇒ Boolean
31 32 33 |
# File 'lib/referral_box/models/transaction.rb', line 31 def redeemed? transaction_type == "redeem" end |