Class: ActiveRecord::ConnectionAdapters::TableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/gem_initializer.rb

Instance Method Summary collapse

Instance Method Details

#from_active_record_belongs_to(*args) ⇒ Object



7
8
9
10
11
# File 'lib/generators/templates/gem_initializer.rb', line 7

def from_active_record_belongs_to (*args)
  options = args.extract_options!
  column_names = args
  column_names.each { |name| column("#{name}_id".to_sym, 'string', options) }
end