diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-10 11:47:25 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-10 11:47:25 -0300 |
commit | 4bd2a50f882065ab4113df4c5711dd1a156a465b (patch) | |
tree | 1494aae135529e4724b2f18e8bf300e9e043895a /activerecord/lib/active_record/connection_adapters | |
parent | d5f480c5324c02d89b23e24a92a7a4ea58de59bc (diff) | |
parent | 47f1c10c8fb7ed9f8999dda5b4a7f42e34afeec6 (diff) | |
download | rails-4bd2a50f882065ab4113df4c5711dd1a156a465b.tar.gz rails-4bd2a50f882065ab4113df4c5711dd1a156a465b.tar.bz2 rails-4bd2a50f882065ab4113df4c5711dd1a156a465b.zip |
Merge pull request #15609 from sgrif/sg-yaml-virtual-columns
Keep the types of virtual columns after yaml serialization
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index 72c6990ba5..21273364b9 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -13,7 +13,7 @@ module ActiveRecord ISO_DATETIME = /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z/ end - attr_reader :name, :cast_type, :null, :sql_type, :default_function + attr_reader :name, :cast_type, :sql_type, :default_function delegate :type, :precision, :scale, :limit, :klass, :accessor, :text?, :number?, :binary?, :serialized?, :changed?, @@ -34,7 +34,7 @@ module ActiveRecord @name = name @cast_type = cast_type @sql_type = sql_type - @null = null + @nullable = null @original_default = default @default_function = nil end @@ -61,6 +61,10 @@ module ActiveRecord clone.instance_variable_set('@cast_type', type) end end + + def null + @nullable + end end class NullColumn < Column |