Version 1.0.0, is only compatible with >= 3.1. If you are still bound to < 3.1 please use an older version of this gem.
simple_eav provides a more simple alternative to acts_as_eav_model that works with ActiveRecord without any monkey patching. This gem is designed to be a replacement for acts_as_eav_model.
Acts_as_eav_model's purpose is to provide a model with any number of custom attributes. This project has the same purpose. The difference being maintaining utmost compatibility with ActiveRecord::Base.
This library, to my knowledge, is fully compatible with acts_as_eav_model. This update introduced the ability to specify custom attributes exactly the same as attributes with an actual column in the database ie:
Person.create :attribute_with_column=>true, :attribute_without_column=>true
gem install simple_eav
create_table :people do |t| t.text :custom_attributes # Name this column whatever you like just *make sure* it is a TEXT field .... end
class Person < ActiveRecord::Base include SimpleEav configure_simple_eav :custom_attributes # This sets up the serialization for your custom attributes end
person = Person.new person.name = 'Joe' person.name ~> 'Joe' person = Person.new :name => 'Joe' person.save! person.name ~> 'Joe'
Fork the project.
Make your feature addition or bug fix.
Add tests for it. This is important so I don't break it in a future version unintentionally.
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
Send me a pull request. Bonus points for topic branches.
Copyright © 2011 Tim Linquist
See LICENSE for details.