Ruby on Rails works with an existing database. Rails does the whole plural

What is the deal with this? I work with an existing one, which I myself did not do. Everything in the database is marked in a single form. user, security, specification, etc. I assume that the right way would be users, securities, specifications. At least what the ruby ​​on the rails is trying to find when I create the scaffold.

How can I specifically specify a user, not users in sql. I do not see anywhere in my project where it is looking at sql. I mean, if my model was a user, you would think that she would try to find the user. Instead of users.

Thanks for any help.

+3
source share
2

set_table_name :name_of_the_table ().

:

class User < ActiveRecord::Base
  set_table_name :user
end

, , , , . .

+6
+1

Source: https://habr.com/ru/post/1785211/


All Articles