Module: AccountExt
- Defined in:
- lib/account_ext.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
24 25 26 |
# File 'lib/account_ext.rb', line 24 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#status ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/account_ext.rb', line 28 def status yauth_account = Rails.cache.read("yauth_account_#{self.yauth_account_id}") if yauth_account['is_paid'] { :status => :paid } elsif yauth_account['locked_at'] { :status => :locked } else { :status => :trial, :days_left => 15 - (DateTime.now - DateTime.parse(yauth_account['created_at'])).to_i} end end |
#yauth_account ⇒ Object
39 40 41 |
# File 'lib/account_ext.rb', line 39 def yauth_account Rails.cache.read("yauth_account_#{yauth_account_id}") end |