Permalink
Browse files

fix typo and improve example [ci skip]

  • Loading branch information...
Francesco Rodriguez
Francesco Rodriguez committed Oct 21, 2012
1 parent c6fb832 commit e32bbc1356a7e72f721373344202c3d63fc37312
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/attribute_methods/before_type_cast.rb
@@ -7,7 +7,7 @@ module BeforeTypeCast
attribute_method_suffix "_before_type_cast"
end
- # Returns the value of the attribuet identified by +attr_name+ before
+ # Returns the value of the attribute identified by +attr_name+ before
# typecasting and deserialization.
#
# class Task < ActiveRecord::Base
@@ -28,6 +28,8 @@ def read_attribute_before_type_cast(attr_name)
# end
#
# task = Task.new(title: nil, is_done: true, completed_on: '2012-10-21')
+ # task.attributes
+ # # => {"id"=>nil, "title"=>nil, "is_done"=>true, "completed_on"=>Sun, 21 Oct 2012, "created_at"=>nil, "updated_at"=>nil}
# task.attributes_before_type_cast
# # => {"id"=>nil, "title"=>nil, "is_done"=>true, "completed_on"=>"2012-10-21", "created_at"=>nil, "updated_at"=>nil}
def attributes_before_type_cast

0 comments on commit e32bbc1

Please sign in to comment.