소스 검색

model add scope

abiao 5 년 전
부모
커밋
15b8ea05df
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/models/product.rb

+ 1 - 1
app/models/product.rb

@@ -129,8 +129,8 @@ class Product < ActiveRecord::Base
     rails_admin do 
         navigation_label '商品管理'
         weight -240
-        authenticate_admin_user!
         list do
+            before_filter :authenticate_admin_user!
 
             if current_admin_user.id==1
                 scopes [:inactive]