diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-03 23:42:59 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 11:58:43 -0300 |
commit | 634ecdbf1b6401ded0e145b1e7c7f4808ad89398 (patch) | |
tree | 11a8fcd4f0dd1b9b9d49165ac36f7f8ba640f69b /activerecord/lib/active_record/connection_adapters | |
parent | 82043ab53cb186d59b1b3be06122861758f814b2 (diff) | |
download | rails-634ecdbf1b6401ded0e145b1e7c7f4808ad89398.tar.gz rails-634ecdbf1b6401ded0e145b1e7c7f4808ad89398.tar.bz2 rails-634ecdbf1b6401ded0e145b1e7c7f4808ad89398.zip |
Return a null column from `column_for_attribute` when no column exists.
This reverts commit ae96f229f6501d8635811d6b22d75d43cdb880a4.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods.rb
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index 65d8b1a8ab..d7f999c3c6 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -77,6 +77,12 @@ module ActiveRecord [self.class, name, default, cast_type, sql_type, null, default_function] end end + + class NullColumn < Column + def initialize(name) + super name, nil, Type::Value.new + end + end end # :startdoc: end |