SimpleHstoreAccessor
Simple Hstore Accessor allows you to treat fields on an hstore column as though they were actual columns in Rails 3.
Installation
Add this line to your application's Gemfile:
gem "simple_hstore_accessor"
And then execute:
$ bundle
Or install it yourself as:
$ gem install simple_hstore_accessor
Setup
The store_accessor
method accepts the name of the hstore column you'd
like to use and an array representing fields to be stored in that column.
class Product < ActiveRecord::Base
store_accessor :options, :color, :price
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Write code and tests
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request