ovenbits/preferential — Issue #2: Make this work with a preferences table
Author: scottymoon
Created: 2011-12-09 01:20:03+00:00
State: open

# Description

Right now we assume a field named after whatever model you are adding preferences to. For example, User expects to have user_preferences. It would be nice to have the option to have this work with a preferences table, so instead of a column, User has_many :user_preferences and everything "just works".

## Assumptions

The preference table will have a name and a value column to store the preferences and their values.

## Example

class User < ActiveRecord::Base
has_many :user_preferences

include Preferential
pref_accessible :favorite_color

end

class UserPreference < ActiveRecord::Base
belongs_to :user
end