I have a simple table with id and name fields and which has some
data which includes ? and ‘’ characters. If I try to find the rows
which have these elements, the query fails with the following error:
irb(main):013:0* a = Person.find(:all, :conditions => [“name = ???”])
ActiveRecord::PreparedStatementInvalid: wrong number of bind variables
(0 for 3) in: name = ???
raise_if_bind_arity_mismatch' from /activerecord-1.15.2/lib/active_record/base.rb:1426:inreplace_bind_variables’
sanitize_sql_array' from /activerecord-1.15.2/lib/active_record/base.rb:1388:insanitize_sql’
add_conditions!' from /activerecord-1.15.2/lib/active_record/base.rb:1097:inconstruct_finder_sql’
find_every' from /activerecord-1.15.2/lib/active_record/base.rb:418:infind’
So my question is: is there any way to escape the query ? Or better
still, can I do the query without SQL (pure ruby) ?