Module: Account::SystemAccount

Defined in:
app/models/account.rb

Class Method Summary collapse

Class Method Details

.define_account(class_name, &blk) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
# File 'app/models/account.rb', line 91

def self.(class_name, &blk)
  unless class_name.is_a?(Symbol) || class_name.is_a?(String)
    raise ArgumentError
  end

  c = Class.new(Account, &blk)
  self.const_set(class_name.to_sym, c)
  Account.sti_model_map[c.uuid] = c
  Account.sti_key_map[c.to_s] = c.uuid
  c
end