This approach obviously offers more precise control than the simple password-based authentication shown earlier, and is recommended for applications that require multiple levels of access control.
The queries are simple with good performance because you need not do any joins to accessmultiple subclasses, and ActiveRecord can use the type column to determine which records to return.
这些查询简单且性能很好,因为您无需进行任何连接来访问多个子类,ActiveRecord 可以使用 type 列决定哪个记录能够返回。