It seems like a case of messed up naming convention.
As per Rails
naming convention, file names should be in snake_case
and class names in CamelCase
. In your scenario, the file name should be customer_rating.rb
and class name should be CustomerRating
.
After making these changes, use CustomerRating.all
(as the updated class name is CustomerRating
) to fetch all the customer ratings. Do not use Customer_rating.all
.