ROR条件if语句不执行

时间:2013-06-26 17:23:02

标签: ruby-on-rails ibm-midrange

我在模型中有这个部分:

更新了07-25

   if sign_on.acctypw1.strip == "DS" or sign_on.acctypw1.strip == "DSD"         
        rec = SignOn.find_by_userw1!(login)            
        webid = rec.prfdstw1               
    end 
        weboel23 = Weboel23.first(:conditions => {:act223 => webid}, :select => "emal23")   


    approval0=Weboel23.find_by_account0(!webid)
    approval1=Weboel23.find_by_account1(!webid)
    approval2=Weboel23.find_by_account2(!webid)
    approval3=Weboel23.find_by_account3(!webid)
    approval4=Weboel23.find_by_account4(!webid)

此代码似乎确实有效:

  sign_on.acctypw1.strip == "DSD" 

此代码似乎无法运行:

webid = rec.prfdstw1 weboel23 = Weboel23.first(:conditions => {:act223 => webid}, :select =>     "emal23") approval0=Weboel23.get_email_by_account0(webid) 
approval1=Weboel23.get_email_by_account1(webid) approval2=Weboel23.get_email_by_account2(webid)     
approval3=Weboel23.get_email_by_account3(webid) approval4=Weboel23.get_email_by_account4(webid) 

时:

 sign_on.acctypw1.strip == "DS" 

它会运行并返回正确的结果。我需要两个案例来执行。任何想法??

0 个答案:

没有答案