Class: ActiveRecord::ConnectionAdapters::ColumnDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord_constraints.rb

Instance Method Summary collapse

Instance Method Details

#add_column_options_with_constraints!(sql, options) ⇒ Object

ColumnDefinition@add_column_options! is called which calls base.add_column_options! by to_sql of ColumnDefinition. We capture this call so that we can merge in the options we are interested in (namely, all of the original options used in to create the column



278
279
280
281
# File 'lib/activerecord_constraints.rb', line 278

def add_column_options_with_constraints!(sql, options)
  ActiveRecord::Base.logger.debug("IN: ColumnDefinition#add_column_options_with_constraints!")
  add_column_options_without_constraints!(sql, options.merge(@options))
end

#optionsObject

Will contain all the options used on a column definition



261
262
263
264
# File 'lib/activerecord_constraints.rb', line 261

def options
  ActiveRecord::Base.logger.debug("IN: ColumnDefinition#options")
  @options
end

#options=(arg) ⇒ Object

Called from TableDefinition#column_with_constraints so we remember the options for each column being defined.



268
269
270
271
# File 'lib/activerecord_constraints.rb', line 268

def options=(arg)
  ActiveRecord::Base.logger.debug("IN: ColumnDefinition#options=")
  @options = arg
end