ruby subclass filter
- by Nik
Hey! Maybe I am getting the idea of a subclass wrong, but I have a Person model and it has an attrib called "age" so
Person.first.age #=> '20'
Now I want to have a model that's basically persons 55 or older so I know I can have a class like this:
class Senior < Person
end
But how can I "pre-filter" the Senior class so that every object belonging to that class has age = 55?
Senior.first.age #=> 56
Thanks!