Module: WraithDB::Adapters::WraithFunctionality
- Included in:
- DefaultAdapter, Mysql2Adapter
- Defined in:
- lib/wraithdb/adapters/wraith_functionality.rb
Instance Attribute Summary collapse
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
- #add_index(*args) ⇒ Object
- #create_table(table_name, options = {}) {|table_definition| ... } ⇒ Object
- #initialize ⇒ Object
- #support_migrations? ⇒ Boolean
Instance Attribute Details
#tables ⇒ Object (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
15 16 17 18 19 20 21 22 |
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 15 def create_table(table_name, = {}) table_definition = ActiveRecord::ConnectionAdapters::TableDefinition.new(self) table_definition.primary_key([:primary_key] || ActiveRecord::Base.get_primary_key(table_name.to_s.singularize)) unless [:id] == false yield table_definition if block_given? @tables[table_name.to_s] = table_definition end |
#initialize ⇒ Object
6 7 8 9 |
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 6 def initialize @active = true @tables = {} end |
#support_migrations? ⇒ Boolean
11 12 13 |
# File 'lib/wraithdb/adapters/wraith_functionality.rb', line 11 def support_migrations? true end |