I would do it like this but I am still learning.
def age
self.years
end
def age=(new_age)
self.years=new_age
end
Jean
On 6/6/05, Rich Collins <rcolli2-odAbcf0Mc9JJm/Hvfsr4+Q@public.gmane.org>
wrote:> What technique is typically used to change the name of the attributes
> for an active record so that they do not match the column names in the
> database?
>
> ex.
>
> in DB:
> Table Person:
> ID int
> NAME varchar
> YEARS int
>
> in ActiveRecord
> person.id
> person.name
> person.age
>
> Thanks,
>
> Rich Collins
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>