diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-04-20 22:13:17 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-04-20 22:13:17 +0200 |
commit | 3ff6b800f2fc3552d98a0a31947c66a21e4479eb (patch) | |
tree | df5115556d7099ee0372588f579e8d881f74e22b /activerecord/lib/active_record | |
parent | fa8920256bd40c7559c7105026f93dd912741d4d (diff) | |
parent | 62c01d3c1f9a117d6869cb006e1cfe1ed456df04 (diff) | |
download | rails-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/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 5 |
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 |