描述:
数据库中有一个 表 : users
id : 1
name : myname
role : customer
id :2
name :amdin
role :admin
还有两个model :user, customer
问题:
在CustomerController中使用
customers = Customer.find(:all) #实际数据是 User.find(:all, :conditions =>[:role => 'customer'])
请问如何在customer model 中设置一下? 或者别的方法做到?