Module: Submane::ModelAttributes
- Defined in:
- app/models/concerns/submane/model_attributes.rb
Instance Method Summary collapse
- #active_plan ⇒ Object
- #active_plan? ⇒ Boolean (also: #subcribed?)
- #active_subcriptions ⇒ Object
- #active_subscription ⇒ Object
- #create_subscription ⇒ Object
Instance Method Details
#active_plan ⇒ Object
9 10 11 |
# File 'app/models/concerns/submane/model_attributes.rb', line 9 def active_plan subscriptions.where("end_date > ?", Time.now).order(:end_date).last.submane_plan end |
#active_plan? ⇒ Boolean Also known as: subcribed?
13 14 15 |
# File 'app/models/concerns/submane/model_attributes.rb', line 13 def active_plan? subscriptions.where("end_date > ?", Time.now).exists? end |
#active_subcriptions ⇒ Object
5 6 7 |
# File 'app/models/concerns/submane/model_attributes.rb', line 5 def active_subcriptions subscriptions.where("end_date > ?", Time.now).order(:end_date) end |
#active_subscription ⇒ Object
17 18 19 |
# File 'app/models/concerns/submane/model_attributes.rb', line 17 def active_subscription subscriptions.where("end_date > ?", Time.now).order(:end_date).last end |
#create_subscription ⇒ Object
3 |
# File 'app/models/concerns/submane/model_attributes.rb', line 3 def create_subscription; end |