Module: Torque::PostgreSQL::Adapter::SchemaCreation

Defined in:
lib/torque/postgresql/adapter/schema_creation.rb

Instance Method Summary collapse

Instance Method Details

#add_table_options!(create_sql, o) ⇒ Object

Inherits are now setup via table options, but keep the implementation supported by this gem



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/torque/postgresql/adapter/schema_creation.rb', line 8

def add_table_options!(create_sql, o)
  if o.inherits.present?
    # Make sure we always have parenthesis
    create_sql << '()' unless create_sql[-1] == ')'

    tables = o.inherits.map(&method(:quote_table_name))
    create_sql << " INHERITS ( #{tables.join(' , ')} )"
  end

  super(create_sql, o)
end