Implementation of EAV pattern for ActiveRecord models