From 66f44e6cbbec39e217f9cff167608f98ecc6260a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 25 Jan 2005 20:00:20 +0000 Subject: Updated documentation for serialize git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@512 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index b0ad90b10b..293fe0c833 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -124,11 +124,11 @@ module ActiveRecord #:nodoc: # user = User.create("preferences" => { "background" => "black", "display" => large }) # User.find(user.id).preferences # => { "background" => "black", "display" => large } # - # You can also specify an optional :class_name option that'll raise an exception if a serialized object is retrieved as a + # You can also specify an class option as the second parameter that'll raise an exception if a serialized object is retrieved as a # descendent of a class not in the hierarchy. Example: # # class User < ActiveRecord::Base - # serialize :preferences, :class_name => "Hash" + # serialize :preferences, Hash # end # # user = User.create("preferences" => %w( one two three )) @@ -171,8 +171,7 @@ module ActiveRecord #:nodoc: # * +AdapterNotSpecified+ -- the :adapter key used in establish_connection specified an unexisting adapter # (or a bad spelling of an existing one). # * +AssociationTypeMismatch+ -- the object assigned to the association wasn't of the type specified in the association definition. - # * +SerializationTypeMismatch+ -- the object serialized wasn't of the class specified in the :class_name option of - # the serialize definition. + # * +SerializationTypeMismatch+ -- the object serialized wasn't of the class specified as the second parameter. # * +ConnectionNotEstablished+ -- no connection has been established. Use establish_connection before querying. # * +RecordNotFound+ -- no record responded to the find* method. # Either the row with the given ID doesn't exist or the row didn't meet the additional restrictions. -- cgit v1.2.3