Class: ActiveScaffold::Tableless::Connection

Inherits:
ActiveRecord::ConnectionAdapters::AbstractAdapter
  • Object
show all
Defined in:
lib/active_scaffold/tableless.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, *args) ⇒ Connection

Returns a new instance of Connection.


29
30
31
32
# File 'lib/active_scaffold/tableless.rb', line 29

def initialize(klass, *args)
  super(nil, *args)
  @klass = klass
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass


28
29
30
# File 'lib/active_scaffold/tableless.rb', line 28

def klass
  @klass
end

Instance Method Details

#columns(table_name) ⇒ Object


34
35
36
# File 'lib/active_scaffold/tableless.rb', line 34

def columns(table_name)
  klass.columns
end

#data_sourcesObject


39
40
41
# File 'lib/active_scaffold/tableless.rb', line 39

def data_sources
  klass ? [klass.table_name] : []
end