I am trying to access all records of a table that has an underscore in its name.
For example if I have table in my schema that is called trips
I can do Trip.all
in rails console. But what do I do if my table name contains an underscore (e.g. users_foods
)
I tried the following options:
Users_food.all
User_food.all
User_foods.all
etc.
All of the above did not work, any suggestions?
Figured it out
One can access the data with UserFood
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With