1 Reply Latest reply on May 24, 2013 12:53 AM by Mark Nongkhlaw

    Not quite getting the correct syntax, please help

    Mark Nongkhlaw

      There's something probably wrong with my find syntax. There are 2 records in my Rhom database with the same fields and values, except for one, viz., obj_code which has values of '31' in one record and '35' in another. I tried to find the first record matching obj_code value '31' like so :

       

      @apps=Approval.find(:first, :conditions => {'sector_code' => '12'} && {'sub_sector_code' => '72'} && {'scheme_code' => '237'} && {'func_hd' => '2552008004300'} && {'obj_code' => '31'} && {'project_id' => '1908'} && {'approval_date' => '2011/03/29'} && {'approval_no' => 'NEC/AGRI/NERCORMP/Piggery/2011'} && {'imp_code' =>'890'} && {'fin_code' => '2010-2011'})  

       

      But it always finds only the record with the obj_code of value '35' instead.

       

      Would be thankful if someone can correct my (possibly) incorrect syntax.