Rails bug: incorrect sql generated or no error checking per

I wrote the following rails code in one of my models:

 su = self.find(:first,
        ["scrape_type = ? and finished = 0", scrapetype],
        :order=>"updated_at");

According to development.log, this generated the following SQL:

SELECT * FROM scrape_urls ORDER BY updated_at LIMIT 1

Note that the man page
http://rubyonrails.org/api/classes/ActiveRecord/Base.html contains an
example with the above format:

Company.find(:first, [
"id = :id AND name = :name AND division = :division AND created_at

:accounting_date",
{ :id => 3, :name => “37signals”, :division => “First”,
:accounting_date => ‘2005-01-01’ }
])

Bug #1: Since rails ignored the array that I supplied, Rails should
have generated an error.

Bug #2: The documentation is probably incorrect. I currently suspect
that the phrase “:condition=>” should appear before the open bracket.

Bug #3: It’s too hard to figure out how to submit a bug report to
rails. Hope you guys find this and fix your code.

Bug #2: The documentation is probably incorrect. I currently suspect
that the phrase “:condition=>” should appear before the open bracket.

This is the case.

Bug #3: It’s too hard to figure out how to submit a bug report to

rails. Hope you guys find this and fix your code.

To create a new ticket, visit http://dev.rubyonrails.org/newticket

You must first login[http://dev.rubyonrails.org/login] or register[
http://dev.rubyonrails.org/register].

Mark


Mark Van H.
[email protected]
http://lotswholetime.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