diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/store_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/models/admin/user.rb | 1 | ||||
-rw-r--r-- | activerecord/test/schema/schema.rb | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/store_test.rb b/activerecord/test/cases/store_test.rb index 0c9f7ccd55..6f632b4d8d 100644 --- a/activerecord/test/cases/store_test.rb +++ b/activerecord/test/cases/store_test.rb @@ -162,4 +162,8 @@ class StoreTest < ActiveRecord::TestCase assert_equal [:color], first_model.stored_attributes[:data] assert_equal [:width, :height], second_model.stored_attributes[:data] end + + test "YAML coder initializes the store when a Nil value is given" do + assert_equal({}, @john.params) + end end diff --git a/activerecord/test/models/admin/user.rb b/activerecord/test/models/admin/user.rb index 4c3b71e8f9..9a80aaba01 100644 --- a/activerecord/test/models/admin/user.rb +++ b/activerecord/test/models/admin/user.rb @@ -14,6 +14,7 @@ class Admin::User < ActiveRecord::Base end belongs_to :account + store :params, accessors: [ :color ], coder: YAML store :settings, :accessors => [ :color, :homepage ] store_accessor :settings, :favorite_food store :preferences, :accessors => [ :remember_login ] diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index ac546fc296..ddfc1ac0d6 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -45,6 +45,7 @@ ActiveRecord::Schema.define do t.string :preferences, null: true, default: '', limit: 1024 t.string :json_data, null: true, limit: 1024 t.string :json_data_empty, null: true, default: "", limit: 1024 + t.text :params t.references :account end |