aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-04-20 22:13:17 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2016-04-20 22:13:17 +0200
commit3ff6b800f2fc3552d98a0a31947c66a21e4479eb (patch)
treedf5115556d7099ee0372588f579e8d881f74e22b /activerecord/lib
parentfa8920256bd40c7559c7105026f93dd912741d4d (diff)
parent62c01d3c1f9a117d6869cb006e1cfe1ed456df04 (diff)
downloadrails-3ff6b800f2fc3552d98a0a31947c66a21e4479eb.tar.gz
rails-3ff6b800f2fc3552d98a0a31947c66a21e4479eb.tar.bz2
rails-3ff6b800f2fc3552d98a0a31947c66a21e4479eb.zip
Merge pull request #24221 from gregmolnar/uuid
create_join_table should work with uuid
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 4f361fed6b..104ca54793 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -342,12 +342,13 @@ module ActiveRecord
column_options = options.delete(:column_options) || {}
column_options.reverse_merge!(null: false)
+ type = column_options.delete(:type) || :integer
t1_column, t2_column = [table_1, table_2].map{ |t| t.to_s.singularize.foreign_key }
create_table(join_table_name, options.merge!(id: false)) do |td|
- td.integer t1_column, column_options
- td.integer t2_column, column_options
+ td.send type, t1_column, column_options
+ td.send type, t2_column, column_options
yield td if block_given?
end
end