Class: RubyMVC::ActiveRecordModelRegistry

Inherits:
Hash
  • Object
show all
Defined in:
lib/ruby_mvc/ar_support.rb

Instance Method Summary collapse

Instance Method Details

#model(etk, options = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/ruby_mvc/ar_support.rb', line 38

def model(etk, options = {})
  key = etk
  key = etk.to_s.to_sym if !etk.is_a? Symbol
  if has_key? key
    self[key]
  else
    self[key] = Models::ActiveRecordTableModel.new(etk, options)
  end
end