2012-10-09 51 views

回答

-2

您可以使用未範圍

從mongoid DOC:

Band.unscoped.where(name: "Depeche Mode") 
Band.unscoped do 
    Band.where(name: "Depeche Mode") 
end 

請參考: mongoid scoping

+3

我明白如何在mongoid中完成它,只是不知道如何使用rails_admin插入它。 – Kamilski81

1

可以命名範圍是rails_admin提供的用於名單行動,他們將顯示爲列表動作中的標籤:

list do 
    scopes [:unscoped, :all, :any_other_scope] 
end