Class: Effective::Subscription

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/subscription.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



45
46
47
# File 'app/models/effective/subscription.rb', line 45

def <=>(other)
  (name || '') <=> (other.try(:name) || '')
end

#active?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/effective/subscription.rb', line 41

def active?
  status == 'active'
end

#planObject



37
38
39
# File 'app/models/effective/subscription.rb', line 37

def plan
  EffectiveOrders.stripe_plans[stripe_plan_id]
end

#to_sObject



33
34
35
# File 'app/models/effective/subscription.rb', line 33

def to_s
  name.presence || 'New Subscription'
end