Permalink
Browse files

update ActiveRecord::AttributeMethods::Serialization documentation [c…

…i skip]
  • Loading branch information...
1 parent 1df502e commit 525ffc52fbeee72bb241b81a188c9cd44d933014 Francesco Rodriguez committed Apr 5, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 activerecord/lib/active_record/attribute_methods/serialization.rb
@@ -11,6 +11,12 @@ module Serialization
end
module ClassMethods
+ ##
+ # :method: serialized_attributes
+ #
+ # Returns a hash of all the attributes that have been specified for
+ # serialization as keys and their class restriction as values.
+
# If you have an attribute that needs to be saved to the database as an
# object, and retrieved as the same object, then specify the name of that
# attribute using this method and it will be handled automatically. The
@@ -44,6 +50,7 @@ def serialize(attr_name, class_name = Object)
end
end
+ # *DEPRECATED*: Use ActiveRecord::AttributeMethods::Serialization::ClassMethods#serialized_attributes class level method instead.
def serialized_attributes
message = "Instance level serialized_attributes method is deprecated, please use class level method."
ActiveSupport::Deprecation.warn message

0 comments on commit 525ffc5

Please sign in to comment.