search for: hides_attribut

Displaying 1 result from an estimated 1 matches for "hides_attribut".

Did you mean: hides_attribute
2006 Jul 28
0
STI hiding attributes
..., email varchar(100) not null, /* attributes for type = Customer */ balance decimal(10,2), /* attributes for type = Employee */ reports_to int, dept int, /* attributes for type = Manager */ /* -- none -- */ ) class Person < ActiveRecord::Base end class Customer < Person hides_attribute :reports_to, :dept end class Employee < Person hides_attribute :balance end class Manager < Employee hides_attribute :reports_to, :dept end The extension will put out the attributes specified in hides_attribute so a Customer object will no longer respond to reports_to, reports_to=, dep...