diff options
author | Rick Olson <technoweenie@gmail.com> | 2008-01-11 19:54:19 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2008-01-11 19:54:19 +0000 |
commit | ebfd03b938d2cb996bc5786768e339b7221a724d (patch) | |
tree | 7e7bdf0b6fc537f9421afe171af22aab79baac6c /activerecord/lib/active_record | |
parent | 5d1a305f066daf5a60b2b1158d5d2aeae6fe32cb (diff) | |
download | rails-ebfd03b938d2cb996bc5786768e339b7221a724d.tar.gz rails-ebfd03b938d2cb996bc5786768e339b7221a724d.tar.bz2 rails-ebfd03b938d2cb996bc5786768e339b7221a724d.zip |
Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 79b66be8ef..8b2f3ad5d4 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -453,9 +453,7 @@ module ActiveRecord polymorphic = options.delete(:polymorphic) args.each do |col| column("#{col}_id", :integer, options) - unless polymorphic.nil? - column("#{col}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : {}) - end + column("#{col}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : options) unless polymorphic.nil? end end alias :belongs_to :references |