i should check whether there is some values based on this condition. if there is some, then i should do one action or else do a different action.
i work on rails, mysql and xp
this is not working @test.nil?
suggest me a alternate way
@test=Model.find(:all,:conditions=>”id=@someid”)
thanks in advance
i should check whether there is some values based on this condition. if there
Share
@test.nil?should work fine. It’s probably not working because your find method is wrong. Try this instead:An alternative syntax is:
—Which will raise a
RecordNotFoundexception if the record doesn’t exist.