Question on clearing Active Record objects

I have the following function that will do a query for me, the problem I am having (being new to Ruby and RoR) is how to reinitialize the object. Right now it always returns the same value.

class AutoHarnesses < ActiveRecord::Base
end

def get\_testruns\(io\)
    agents = AutoHarnesses\.new\(\)
    io\.puts "What Agent's test runs do you want to see?\\n"
    io\.print "Agent Name = "
    my\_agent = io\.gets\.chomp
    io\.puts "Looking for \#\{my\_agent\}\\n"
    begin
        \# I think this is the query I want\.\.\.\.
        agents = AutoHarnesses\.first\(\)
        io\.puts %\{Found \#\{agents\.testname\} \- \#\{agents\.status\}\}
    rescue
        puts $\!
    end
end

I thought by having a new call at the beginning I could reinitialize the object and clear it out so that I would always get a new one, or if

Well you do create a new instance of AutoHarnesses, but you then overwrite that with the result of AutoHarnesses.first which will always return the same thing.

Frd

Frederick Cheung wrote:

Well you do create a new instance of AutoHarnesses, but you then overwrite that with the result of AutoHarnesses.first which will always return the same thing.

Frd

Ok...I had forgotten about first being like that. So if I have to look for just one machine what is the best option for select in this case? I'm just trying to keep it simple and I haven't had much luck with using some of the select options as I keep getting undefined method errors.