Skip to content
A simple alternative to acts_as_eav_model.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Bump version removing shelling out during loading of gemspec
.gitignore We shouldn't keep Gemfile.lock in a library.
.rvmrc Use latest patchlevel
README.rdoc Fix dated links to repo
Rakefile Shelling out in the gemspec is bad news bears
gemspec.rb Remove whitespace from template output
simple_eav.gemspec Updating gemspec from parsed erb template moving forward




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


1. Create the migration for your model

create_table :people do |t|
  t.text  :custom_attributes # Name this column whatever you like just *make sure* it is a TEXT field

2. Configure simple_eav in your model

class Person < ActiveRecord::Base
  include SimpleEav

  configure_simple_eav :custom_attributes # This sets up the serialization for your custom attributes

3. Set and Get custom attributes as if they were a normal attribute on your model

person = = 'Joe' ~> 'Joe'

person = :name => 'Joe'! ~> '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.


Tim Linquist


Copyright © 2011 Tim Linquist

See LICENSE for details.

Something went wrong with that request. Please try again.