There is such a table
Is it possible to refer to the lines by some unique name? Sort of
User.where(role: :admin) There is such a table
Is it possible to refer to the lines by some unique name? Sort of
User.where(role: :admin) If I understand correctly, then you want to make the distribution of users by roles. For this you have several options:
Write the roles in a separate column of the same table (add the role column to the table)
Make a separate roles table, and add a foreign key to the users table. That is, the column role_id appears in the users table. This will allow you to dynamically add / delete roles without touching the code.
Make a separate roles table and a link table, for example users_roles and use links to through
Source: https://ru.stackoverflow.com/questions/589154/
All Articles
admin. - D-side