[问题求助]似乎model中只能运行一个ActiveRecord

def self.create_selenium_parameters(case_name,site_id,selenium_filename)
  puts "create_selenium_parameters begin"
  begin 
    parameters_head = "<html>
          <head>
          <meta http-equiv=\'Content-Type\' content=\'text/html; charset=UTF-8\'>
          <title>#{ case_name}</title>
          </head>
          <body>
          <table cellpadding=\'1\' cellspacing=\'1\' border=\'1\'>
          <thead>
          <tr><td rowspan=\'1\' colspan=\'3\'>#{ case_name}</td></tr>
          </thead><tbody>"
    sql = "select * from case_parameters where case_name='" + case_name + "' and site_id=" + site_id
    @case_parameter = CaseParameter.find_by_sql sql
   
    sql1 = "select * from case_statuses"
    puts sql1
    @case_status = CaseStatus.find_by_sql sql1
   
    sql2 = "select * from test_scripts where case_name='" + case_name + "'"
    puts sql2
    @test_script = TestScript.find_by_sql sql2

这段代码只有CaseParameter能成功。到了CaseStatus,就不执行了。
如果把CaseParameter注释掉。CaseStatus就能执行通过。

这个是什么原因,有什么办法能work around?