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.



11
12
13
14
# File 'lib/active_scaffold/tableless.rb', line 11

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

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



10
11
12
# File 'lib/active_scaffold/tableless.rb', line 10

def klass
  @klass
end

Instance Method Details

#columns(table_name) ⇒ Object



16
17
18
# File 'lib/active_scaffold/tableless.rb', line 16

def columns(table_name)
  klass.columns
end

#data_sourcesObject



21
22
23
# File 'lib/active_scaffold/tableless.rb', line 21

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