浏览代码

测试 before 事件

abiao 5 年之前
父节点
当前提交
af55a93659
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/models/product.rb

+ 2 - 1
app/models/product.rb

@@ -10,7 +10,7 @@ class Product < ActiveRecord::Base
     #after_update :after_update
     before_save :before_save
     after_destroy :del_picture
-    do_something
+
     def do_something
         puts params
     end
@@ -133,6 +133,7 @@ class Product < ActiveRecord::Base
 
         list do
             filters [:id,:detail,:status,:name]
+            do_something
             field :id
             field :merchant_id
             field :merchant