Skip to content
Browse files

Copy edit [ci skip]

  • Loading branch information...
1 parent f443e11 commit 9b40f5cc36c38fca7e78008eb1df97a93a849f89 @rafaelfranca rafaelfranca committed May 13, 2012
Showing with 5 additions and 3 deletions.
  1. +1 −0 activerecord/CHANGELOG.md
  2. +4 −3 activerecord/lib/active_record/store.rb
View
1 activerecord/CHANGELOG.md
@@ -1,4 +1,5 @@
## Rails 4.0.0 (unreleased) ##
+
* Added custom coders support for ActiveRecord::Store. Now you can set
your custom coder like this:
View
7 activerecord/lib/active_record/store.rb
@@ -13,17 +13,18 @@ module ActiveRecord
# You can set custom coder to encode/decode your serialized attributes to/from different formats.
# JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+.
#
+ # String keys should be used for direct access to virtual attributes because of most of the coders do not
+ # distinguish symbols and strings as keys.
+ #
# Examples:
#
# class User < ActiveRecord::Base
# store :settings, accessors: [ :color, :homepage ], coder: JSON
# end
#
# u = User.new(color: 'black', homepage: '37signals.com')
- # u.color # Accessor stored attribute
+ # u.color # Accessor stored attribute
# u.settings['country'] = 'Denmark' # Any attribute, even if not specified with an accessor
- # String keys should be used for direct access to virtual attributes because of most of the coders do not
- # distinguish symbols and strings as keys.
#
# # Add additional accessors to an existing store through store_accessor
# class SuperUser < User

0 comments on commit 9b40f5c

Please sign in to comment.
Something went wrong with that request. Please try again.