S
Shandy Nantz
Hi all,
I have this ruby script that simple rips through a CSV file, retrieves a
username and then search my database for that user and any associated
data. My problem is that the query I'm using to find my users isn't
working even though this is pretty basic stuff that I am trying to do.
My query looks a little something like this:
@finduser = User.findfirst, :conditions => ['upper(username) = ?',
x[11].to_s.upcase])
x[11] is the field in my csv file that has the username, other then
that this is a simple script, but the user is never being found even
though ActiveRecord has the correct host and adapter information. My
question is there anyway to output the query string from my object or
the query that is being built? The only thing I can think of is that the
query is not being built correctly since for some of my test users the
correct username is there and should be found. Thanks in advance and
happy holidays,
-S
I have this ruby script that simple rips through a CSV file, retrieves a
username and then search my database for that user and any associated
data. My problem is that the query I'm using to find my users isn't
working even though this is pretty basic stuff that I am trying to do.
My query looks a little something like this:
@finduser = User.findfirst, :conditions => ['upper(username) = ?',
x[11].to_s.upcase])
x[11] is the field in my csv file that has the username, other then
that this is a simple script, but the user is never being found even
though ActiveRecord has the correct host and adapter information. My
question is there anyway to output the query string from my object or
the query that is being built? The only thing I can think of is that the
query is not being built correctly since for some of my test users the
correct username is there and should be found. Thanks in advance and
happy holidays,
-S