Module: Submane::Attributes

Included in:
Submane
Defined in:
lib/submane/attributes.rb

Instance Method Summary collapse

Instance Method Details

#create_plan(plan) ⇒ Object



11
12
13
# File 'lib/submane/attributes.rb', line 11

def create_plan(plan)
  Submane::Plan.create(plan)
end

#create_plan!(plan) ⇒ Object



7
8
9
# File 'lib/submane/attributes.rb', line 7

def create_plan!(plan)
  Submane::Plan.create!(plan)
end

#plan_active_subscriptions(plan_id) ⇒ Object



3
4
5
# File 'lib/submane/attributes.rb', line 3

def plan_active_subscriptions(plan_id)
  Submane::Subscription.where("plan_id = ? AND end_date > ?", plan_id, Time.now)
end