Class: Susply::Subscription

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

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/susply/subscription.rb', line 19

def active?
  deactivated_at.nil?
end

#allowed_to_renew?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/models/susply/subscription.rb', line 27

def allowed_to_renew?
  active? && expired?
end

#expired?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/susply/subscription.rb', line 23

def expired?
  current_period_end < Time.zone.now
end

#nameObject



11
12
13
# File 'app/models/susply/subscription.rb', line 11

def name
  plan.name
end

#priceObject



15
16
17
# File 'app/models/susply/subscription.rb', line 15

def price
  plan.price
end