Custom typecast method for ActiveRecord object's attribute?

If you're just wanting to manipulate what name returns...do this class Project.

If you're just wanting to manipulate what name returns...do this... class Project.

What I wanted to do was take a field that normally returns an integer and be able to call to_s on it and do a lookup and return the string equivalent. So if the integer returns 1 then to_s returns "active. " Like I said, I know I can do this with helpers, but I wondered if you could do it at the model level.

– Beerrepository Dec 21 '10 at 20:08.

ActiveRecord method decrement! Updates other attributes as well. Why is that?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions