Class: ActiveRecord::ConnectionAdapters::InterBaseTableDefinition

Inherits:
TableDefinition
  • Object
show all
Defined in:
lib/active_record/connection_adapters/interbase_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pk_fieldObject (readonly)

Returns the value of attribute pk_field.



81
82
83
# File 'lib/active_record/connection_adapters/interbase_adapter.rb', line 81

def pk_field
  @pk_field
end

Instance Method Details

#primary_key(name) ⇒ Object



83
84
85
86
87
88
89
90
91
# File 'lib/active_record/connection_adapters/interbase_adapter.rb', line 83

def primary_key(name)
  col_count = @columns ? @columns.size : 0
  
  column(name, :integer, {:null => false} )
  
  if col_count != @columns.size # a column got added
    @pk_field = @columns.last
  end
end