Is there a way to do this correctly; here's my "Person" model:
def name
name.gsub("Jr.", "Junior")
end
I have a "name" column in my database, and I want to replace "Jr." with
"Junior" every time @person.name is called.
I'm getting a "stack level is too deep" error when I put the above
definition in my model. I figure I could just rename the method to
something like "filtered_name" but is there a more efficient way to do
this?
Awesome. Thank you Philip! The @person.name.expand_abbreviations sounds
like a great idea. Thanks so much. I appreciate your kind warning and
your fantastic solution.