moomerman/preferences — pull request #2 by kgen (2012-01-18 18:22:53+00:00)
Title: Reset definitions so that other subclass definitions aren't inherited.

Bug:
----

class User < ActiveRecord::Base
preference :age, :integer
preference :language, :string, default: 'English'
end

class Manager < User
preference :color, :string
preference :speed, :integer, default: 10
end

class Assistant < User
preference :year, :integer
end

Then:
----

u2 = User.create(email: 'u2@kingaxis.com', password: '1')
m2 = Manager.create(email: 'm2@kingaxis.com', password: '1')
a2 = Assistant.create(email: 'a2@kingaxis.com', password: '1')

u2.preferences
=> {"age"=>nil, "language"=>"English", "color"=>nil, "speed"=>10, "year"=>nil}

m2.preferences
=> {"age"=>nil, "language"=>"English", "color"=>nil, "speed"=>10, "year"=>nil}

a2.preferences
=> {"age"=>nil, "language"=>"English", "color"=>nil, "speed"=>10, "year"=>nil}

Patch:
----
This patch fix it.