diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-23 17:03:36 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-23 17:03:36 -0200 |
commit | b5636e4fd8b0efbe8c8ca1879d0d7fbb7ad24fc7 (patch) | |
tree | 5168c9816bcfe9b7ecf312623e80ad27cfef94f6 /activerecord | |
parent | 5e8102179aa6403f56e757f22451f784ea43aebd (diff) | |
download | rails-b5636e4fd8b0efbe8c8ca1879d0d7fbb7ad24fc7.tar.gz rails-b5636e4fd8b0efbe8c8ca1879d0d7fbb7ad24fc7.tar.bz2 rails-b5636e4fd8b0efbe8c8ca1879d0d7fbb7ad24fc7.zip |
Only show the type if column is present
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index 8cc7c50020..44ac37c498 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -71,7 +71,8 @@ module ActiveRecord when Date, Time then quoted_date(value) when Symbol then value.to_s else - raise TypeError, "can't cast #{value.class} to #{column.type}" + to_type = column ? " to #{column.type}" : "" + raise TypeError, "can't cast #{value.class}#{to_type}" end end |