Nick Sellen
2008-Nov-29 02:17 UTC
active record find conditions currently don''t work correctly if an array with a nil in it is used
I''ve created a patch in lighthouse for this and looking for a bit of feedback. Essential the problem is due to MySQL (and perhaps other database vendors) of returning an empty result set for: select * from somewhere where name in (null) regardless of whether there are records with null entries in that field. the version that does work is: select * from somewhere where name is null with active record this means that the following does not return the expected records: Event.find(:all, :conditions => {:venue_id => [1,2,nil]}) http://rails.lighthouseapp.com/projects/8994/tickets/1486-active-record-conditions-to-deal-with-nils-in-arrays cheers, n --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---