Find functions not working in Ruby 2.0

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.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Apr 8, 2008, at 8:18 AM, Mariko C. wrote:

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/.

Hi, there is no such thing as Ruby 2.0. I think you are talking about
the
framework Rails. The Mailing List can be found here:

http://www.ruby-forum.com/forum/3

I have the impression that this is indeed a bug, bit the Rails guys will
be able to help you.

Greetings
Florian G.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkf7D6sACgkQJA/zY0IIRZZwnQCeJ/n7UAsAwlr5wyp1DyenVI/r
dd8AnRd9Fw83m1P6SWGCmB+f0YZCmpB8
=VN+p
-----END PGP SIGNATURE-----

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’ } ])

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
VIDEO #3 out NOW!
http://sensei.zenunit.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs