From: Julian Leviston Date: 2008-04-08T15:45:42+09:00 Subject: Re: Find functions not working in Ruby 2.0 --Apple-Mail-24--450810484 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Why not use the named binding method? (from the api:) Company.find(:first, :conditions => [ "id = :id AND name = :name AND division = :division AND created_at > :accounting_date", { :id => 3, :name => "37signals", :division => "First", :accounting_date => '2005-01-01' } ]) http://api.rubyonrails.org/classes/ActiveRecord/Base.html Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 08/04/2008, at 4:18 PM, Mariko C. wrote: > So in my older build, code like this would work fine: > inbox = user.messages.find(:all, :conditions=>{:outbox => > false}, :order > => "date DESC", :limit => limit, :offset => offset) > > as well as something like this: > > @tokens = Item.find(:all, :conditions=>{:item_type => "token", :market > => true}).sort_by {|u| u.refname.downcase} > > Now all I'm getting are errors like this: > Mysql::Error: Unknown column 'item_typetokenmarkettrue' in 'where > clause': SELECT * FROM items WHERE (item_typetokenmarkettrue) > > > > I'm not sure to find how to fix this, does anyone know? Thanks for the > help. > -- > Posted via http://www.ruby-forum.com/. > --Apple-Mail-24--450810484--