RubyFlow The Ruby and Rails community linklog

EAV behavior with ActiveRecord ORM and HydraAttribute

I’ve just released the hydra_attribute 0.4.0 gem that allows to create or remove attributes for the model in runtime or assign unique attribute list for each record. Also it is possible to use query methods for selecting or grouping records by that attributes. There are a lot of examples on the github wiki page including database structure that this gem creates.

Comments

A couple of months too late for me, but great work, schema looks really nice. We ended up with a quite similar schema. I just normalized one type to optimize for selects and radios. Storing an id rather than the value. What I lack are the generalized query options and the sets.

I’ll plan to add support of select values but a little bit later because currently I’m working on implementation of all ActiveRecord::Relation methods.

Also, I’ll add support of localized values, something like Globalize3.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in