I've been puzzled for a while over the difference between using a question mark, e.g.
Foo.find(:all, :conditions => ['bar IN (?)', @dangerous])
and using sprintf style field types, e.g.
Bar.find(:all, :conditions => ['qux IN (%s)', @dangerous])
in sanitizing inputs. Is there any security advantage whatsoever, if you know you're looking for a number - like an ID - and not a string, in using %d over ?, or are you just asking for a Big Nasty Error when a string comes along instead?
Does this change at all with the newer .where syntax in Rails 3 and 4?