Implementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord models
Unfortunately, I don't have enough time to work on this gem now. If you feel you can contribute to it, please, reach me via email, and I'll grant permissions to this project.
hydra_attribute is an implementation of EAV (Entity-Attribute-Value) pattern for ActiveRecord models. It allows to create or remove attributes in runtime. Also each record may have different sets of attributes, for example: Product with ID 1 can have different set of attributes than Product with ID 2.
Until the first major version is released:
Add the following line to Gemfile:
gem 'hydra_attribute'
# or for rails 4
# gem 'hydra_attribute', github: 'kostyantyn/hydra_attribute', branch: 'rails4'
# or for rails 4.1
# gem 'hydra_attribute', github: 'kostyantyn/hydra_attribute', branch: 'rails4.1'and run bundle install from your shell.
Then we should generate our migration:
rails generate migration create_hydra_attributesThe content should be:
class CreateHydraAttributeTables 1, "green"=>3, "red"=>1}git checkout -b my-new-feature)git commit -am 'Added some feature')git push origin my-new-feature)No open issues yet, or sync has not completed.