Explorar o código

model add scope

abiao %!s(int64=5) %!d(string=hai) anos
pai
achega
94876a676c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/models/product.rb

+ 1 - 1
app/models/product.rb

@@ -11,7 +11,7 @@ class Product < ActiveRecord::Base
     after_create :after_create
     before_save :before_save
     after_destroy :del_picture
-    puts AdminUser.current_user
+    puts AdminUser.current_scope
     def after_create
         #主商品默认关联商品
         if self.show_flag