Hi,
Is this a Rails bug?

NORMAL SQL
?> AccountItem.find_by_sql( "select * from account_items where description =
'FISHERS IGA HAMILTON     HAMILTON     AU 000318'")
=> [#<AccountItem id: 1100, account_id: 5, recurring_id: nil, date:
"2008-12-30", amount: #<BigDecimal:24fc840,'-0.4E3',4(12)>, balance:
#<BigDecimal:24fc69c,'0.745538E4',8(12)>, description: "FISHERS IGA HAMILTON
    HAMILTON     AU 000318", notes: nil, projection: false, created_at:
"2009-02-08 22:29:25", updated_at: "2009-02-08 22:29:25">]
>>

WITH FINDER - DOES FIND THE RECORD
?> AccountItem.find(:all, :conditions => ["description = ?", 'FISHERS IGA
HAMILTON     HAMILTON     AU 000318'] )
=> []
EXTRACT FROM SERVER LOG - THE CREATED SQL SEEMS TO BE MISSING THE EXTRA
SPACES??
   [4;36;1mAccountItem Load (3.0ms) [0m    [0;1mSELECT * FROM
`account_items` WHERE (description = 'FISHERS IGA HAMILTON HAMILTON AU
000318') [0m

That is find method seems to be mis-translating the SQL and removing spaces.






-- 
Greg
http://blog.gregnet.org/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to