Ticket #9775: foreign_key_on_migrations.patch
| File foreign_key_on_migrations.patch, 0.8 kB (added by arthurgeek, 1 year ago) |
|---|
-
lib/active_record/connection_adapters/abstract/schema_definitions.rb
old new 376 376 column(:created_at, :datetime) 377 377 column(:updated_at, :datetime) 378 378 end 379 380 def foreign_key(*args) 381 options = args.last.is_a?(Hash) ? args.pop : {} 382 args.each do |col| 383 column(id = "#{col}_id", :integer, options) 384 end 385 end 386 alias :fkey :foreign_key 379 387 380 388 # Returns a String whose contents are the column definitions 381 389 # concatenated together. This string can then be pre and appended to