瀏覽代碼

forbid date

abiao 2 年之前
父節點
當前提交
6d6899fcd6
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/models/forbid_date.rb

+ 3 - 2
app/models/forbid_date.rb

@@ -5,11 +5,12 @@ class ForbidDate < ActiveRecord::Base
 
   TYPE_ENUM = [["早餐",1],["中餐",2],["晚餐",3]]
 
-  after_save :sync_forbid_date
+  after_update :sync_forbid_date
+  after_create :sync_forbid_date
+
   def sync_forbid_date
     #发放未发放赠品
     url = "#{CONFIG_FILE["xj_host"]}/base/synchronize-forbid-food/?id=#{self.id}"
-    p url
     open(url)
   end