소스 검색

wx user id

abiao 2 년 전
부모
커밋
b518d29ce3
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      app/models/employ.rb

+ 2 - 3
app/models/employ.rb

@@ -2,9 +2,8 @@
 class Employ < ActiveRecord::Base
   self.table_name = "employs"
   validates :mobile,:user_name,presence: true
-  after_save :after_save
-
-  def after_save
+  validate :employ_validation
+  def employ_validation
     usr = User.where("tel = ?", self.mobile).first
       if usr.blank?
         wu = WxUser.where("user_id = ?", usr.id).first