diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-10-21 14:12:01 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-10-21 14:12:01 -0500 |
commit | e32bbc1356a7e72f721373344202c3d63fc37312 (patch) | |
tree | d92740c9e5358972521ce0f8a9db04b69ca99ee1 /activerecord/lib/active_record | |
parent | c6fb832fe883ac996c0fa773ee2b5c9fdc2c9f62 (diff) | |
download | rails-e32bbc1356a7e72f721373344202c3d63fc37312.tar.gz rails-e32bbc1356a7e72f721373344202c3d63fc37312.tar.bz2 rails-e32bbc1356a7e72f721373344202c3d63fc37312.zip |
fix typo and improve example [ci skip]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/before_type_cast.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/before_type_cast.rb b/activerecord/lib/active_record/attribute_methods/before_type_cast.rb index 030972fc8a..7fe5411a3b 100644 --- a/activerecord/lib/active_record/attribute_methods/before_type_cast.rb +++ b/activerecord/lib/active_record/attribute_methods/before_type_cast.rb @@ -7,7 +7,7 @@ module ActiveRecord 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 @@ module ActiveRecord # 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 |