Module: Accounts::BelongsToAccount

Defined in:
lib/accounts/belongs_to_account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#padma_accountObject

Returns the value of attribute padma_account.



13
14
15
# File 'lib/accounts/belongs_to_account.rb', line 13

def 
  @padma_account
end

Class Method Details

.included(base) ⇒ Object



9
10
11
# File 'lib/accounts/belongs_to_account.rb', line 9

def self.included(base)
  base.send(:validate, :padma_account_setted_correctly)
end

Instance Method Details

#account(options = {}) ⇒ PadmaAccount / PadmaAccountDecorator

Returns associated account.

account is stored in instance variable padma_account. This allows for it to be setted in a Mass-Load.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • decorated (TrueClass)
    • returns decorated account

  • force_service_call (TrueClass)
    • forces call to accounts-ws

Returns:



23
24
25
26
27
28
29
30
31
32
# File 'lib/accounts/belongs_to_account.rb', line 23

def (options={})
  if self..nil? || options[:force_service_call]
    self. = PadmaAccount.find_with_rails_cache()
  end
  ret = 
  if options[:decorated] && 
    ret = PadmaAccountDecorator.decorate()
  end
  ret
end

#account_tester_levelObject



34
35
36
# File 'lib/accounts/belongs_to_account.rb', line 34

def 
  .try :tester_level
end