aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorthedarkone <thedarkone2@gmail.com>2011-05-21 15:18:09 +0200
committerthedarkone <thedarkone2@gmail.com>2011-05-21 15:18:09 +0200
commit1c614bcb0fb65f0a5541263deacda498e52f447b (patch)
tree883eb4cb1a741fdfb192db2de40bd233a10fc714 /activerecord/lib
parent1a959ad72fc92a82e05e8c271858a64ed14b926e (diff)
downloadrails-1c614bcb0fb65f0a5541263deacda498e52f447b.tar.gz
rails-1c614bcb0fb65f0a5541263deacda498e52f447b.tar.bz2
rails-1c614bcb0fb65f0a5541263deacda498e52f447b.zip
Handle polymorphic_type NOT NULL-able columns as well.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
index 1ca448236e..198ad06360 100644
--- a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
+++ b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
@@ -19,7 +19,7 @@ module ActiveRecord
def klass
type = owner[reflection.foreign_type]
- type && type.constantize
+ type.presence && type.constantize
end
def raise_on_type_mismatch(record)