Explorar o código

model add scope

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

+ 2 - 4
app/models/product.rb

@@ -11,10 +11,8 @@ class Product < ActiveRecord::Base
     after_create :after_create
     before_save :before_save
     after_destroy :del_picture
-    def admin_user
-        puts AdminUser.current
-    end
-    admin_user
+
+    puts AdminUser.current
     def after_create
         #主商品默认关联商品
         if self.show_flag