Topic: Function in model to overwrite default database models
Probably a very simple question!
I have a field in my db called Phone - I don't want to do number_to_phone(@item.phone, :area_code => true) everytime, so I create a function in my model:
number_to_phone(self.phone, :area_code => true)
This gives me "Stack level too deep".
How can I kill the recursion? Sure I could do def formatted_phone - but that's kinda boring