Module: WraithDB::Adapters::WraithFunctionality

Included in:
DefaultAdapter, Mysql2Adapter
Defined in:
lib/wraithdb/adapters/wraith_functionality.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tablesObject (readonly)

Returns the value of attribute tables.



4
5
6
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 4

def tables
  @tables
end

Instance Method Details

#add_index(*args) ⇒ Object



24
25
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 24

def add_index(*args)
end

#create_table(table_name, options = {}) {|table_definition| ... } ⇒ Object

Yields:

  • (table_definition)


15
16
17
18
19
20
21
22
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 15

def create_table(table_name, options = {})
  table_definition = ActiveRecord::ConnectionAdapters::TableDefinition.new(self)
  table_definition.primary_key(options[:primary_key] || ActiveRecord::Base.get_primary_key(table_name.to_s.singularize)) unless options[:id] == false

  yield table_definition if block_given?

  @tables[table_name.to_s] = table_definition
end

#initializeObject



6
7
8
9
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 6

def initialize
  @active = true
  @tables = {}
end

#support_migrations?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 11

def support_migrations?
  true
end