ruby - Rails Active:Record helpers broken with large database -


i imported 850,000 row csv file sqlite database , of sudden find_by_field methods don't work. on rails 3.1 btw.

for instance, model name zip , 1 of fields zipcode, string. if zip.find_by_zipcode(zip.first.zipcode) returns nil. methods work ones aren't on string fields find(:id), find_by_created_at , find_by_latitude, integer. tried indexing fields didn't help. here's snippet:

ruby-1.9.2-p180 :029 > zip.find_by_zipcode(zip.first.zipcode)  zip load (0.2ms)  select "zips".* "zips" limit 1  zip load (0.2ms)  select "zips".* "zips" "zips"."zipcode" = 'a0a 1a0' limit 1  => nil  

anyone have suggestion?

also if zip.where('zipcode ?', zip.first.zipcode) works.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -