Skip to content

Commit

Permalink
Added notes on YAML.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenn committed Sep 19, 2012
1 parent 07210a1 commit c3bef01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,25 @@ end
```

That way, the user won't receive the same alert again, until `unset_delivered` is called when the next billing cycle starts.

## YAML serialization

ActiveRecord::Store uses YAML to serialize Ruby objects. A StoreField will be stored as follows:

```yaml
---
:funnel: !ruby/object:Set
hash:
:add_item: true
:checkout: true
```
As you can see, the `Set` class internally uses `Hash` for its storage.

There is a [known compatibility problem](http://bugs.ruby-lang.org/issues/6910) between `psych` and `syck`, be sure to use `psych` from the beginning.

```ruby
YAML::ENGINE.yamler # => "psych"
```

If you are using Ruby 1.9.2 or later, `psych` should be used by default.

0 comments on commit c3bef01

Please sign in to comment.