I want to get table name in a model method. I found there should be method table_name but when I try to call it I get NameError Exception: undefined local variable or method `ta
But I need that information in the model's instance method. How to get it?
You can simply do this in your instance method:
class Model def instance_method puts Model.table_name end end