#rubyonrails - Sun 29 Apr 2007 between 03:19 and 03:30

NY Lost Funds



daveman1010220But good to know I can do more complicated selects...
Skizit will show the sql being generated
tpopeyou can also be more explicit
daveman1010220Thanks a bunch for the tips people.
Skizonce you work with AR enough and learn the options it comes naturally.
tpopeUser.find(:first, :conditions => ["username = ? and password = ?", params[:username], params[:password]])
Skiz(will return nil or a user object)
tpopeyou do know what bound parameters are don't you?
daveman1010220Yeah, that format looks a bit odd to me, but I get it.
DannoHungpastie
SkizUser.find(:first, { :conditions => ["username = ? and password = ?", params[:username], params[:password]], :limit => 1}) (for hash effect)
pastiehttp://pastie.caboo.se/57411 by DannoHung.
DannoHungI require assitance!
Skiz{} = hash
DannoHungassistance even!
tpopeone problem with just dealing with raw sql, is you end up with coders writing ticking time bombs like "SELECT * FROM usere WHERE password = '" + password + "' AND username = '" + username + "'"
pythonickaboom!
vipacatpope: so did I do this wrong Im not getting the nest affect
I was hoping for
panji_alamnaked sql, hehehe
DannoHungFrom what I can tell, the controller method is never reached from the test
SkizDannoHung: did you forget your user fixtures?
actionpythonic prefers sql injection to snorting sql
pythonicprefers sql injection to snorting sql
tpopevipaca: well how did you do it
DannoHungSkiz: No, other tests requiring fixtures work and...
I'm looking at fixtures :users right now
Skizso what is the error?
vipacato many vnc sessions
wolfshow many of you folks use backgroundrb
vipacawell I implement each class to has_many comments :as => commentable
DannoHungWell, when I put the test at the top, the redirect was going to "activate/longactivationstring". Then, when, I tried putting the not_nil test for the flash at the top, that failed, and now when I'm trying with the equivalence test, that's failing. When I tried to set a breakpoint inside the controller at the top of the controller method, that never got triggered, and as a last resort, I tried "puts"ing from the top of the controlle
vipacathen made comment belong to commentable :polymorphic => true
DannoHungAlso, the functionality works perfectly fine in development.
So I'm scratching my head about what sort of thing this can be
vipacaits an unknown route as is
tpopeyou haven't said anything about your route
DannoHungtpope: Me?
vipacaumm yeah
tpopeyou ahve to specify your routes
DannoHungDid you look at my pastie?

Page: 2 9 16 23 30 37 44 51 58 65 72 79 

IrcArchive

NY Lost Funds