Skip to content

Commit

Permalink
added deprecation notes to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Crismali committed Feb 10, 2015
1 parent 5d1abb3 commit f81de11
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class Product < ActiveRecord::Base
price: :float,
built_at: :datetime,
build_date: :date,
tags: :array,
ratings: :hash
tags: :array, # deprecated
ratings: :hash # deprecated
miles: :decimal
end
```
Expand All @@ -69,16 +69,16 @@ product.price = 99.95
product.built_at = Time.now - 10.days
product.build_date = Date.today
product.popular = true
product.tags = %w(housewares kitchen)
product.ratings = { user_a: 3, user_b: 4 }
product.tags = %w(housewares kitchen) # deprecated
product.ratings = { user_a: 3, user_b: 4 } # deprecated
product.miles = 3.14
```

Reading these fields works as well.

```ruby
product.color # => "green"
product.tags # => ["housewares", "kitchen"]
product.price # => 99.95
```

In order to reduce the storage overhead of hstore keys (especially when
Expand Down Expand Up @@ -176,6 +176,8 @@ Product.built_date_after(Date.today - 4.days) # built after the given date

### Array Fields

*Note: the array field type is deprecated. It is available in version 0.9.0 but not > 1.0.0*

For `array` types, two scopes are created:

```ruby
Expand Down Expand Up @@ -267,6 +269,8 @@ hstore_accessor :data, published_at: :time
hstore_accessor :data, published_at: :datetime
```

While the `array` and `hash` types are available in version 0.9.0, they are deprecated and are not available in 1.0.0.

## Contributing
### Basics
1. [Fork it](https://github.com/devmynd/hstore_accessor/fork)
Expand Down

0 comments on commit f81de11

Please sign in to comment.