Skip to content

Instantly share code, notes, and snippets.

@waynehoover
Created June 22, 2011 21:08
Show Gist options
  • Save waynehoover/1041208 to your computer and use it in GitHub Desktop.
Save waynehoover/1041208 to your computer and use it in GitHub Desktop.
irb(main):004:0> Teacher.find_by_id(49)
Teacher Load (0.3ms) SELECT "teachers".* FROM "teachers" WHERE "teachers"."id" = 49 LIMIT 1
=> #<Teacher id: 49, name: "Sam Rice", bio: nil, email: nil, created_at: "2011-06-22 21:03:41", updated_at: "2011-06-22 21:03:41", pic_file_name: nil, pic_content_type: nil, pic_file_size: nil, pic_updated_at: nil>
irb(main):007:0> Teacher.find_by_name("Sam Rice")
Teacher Load (0.3ms) SELECT "teachers".* FROM "teachers" WHERE "teachers"."name" = 'Sam Rice' LIMIT 1
=> nil
@dmonopoly
Copy link

Did you ever find out why this is? I'm curious...

@waynehoover
Copy link
Author

Kind of... It was something to do with my DB import I was doing from a CSV file. I dropped the DB and cleaned up my import file CSV, and it started working. I can't remember what I did to the CSV file, I think it was something with the UTF-8 encoding...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment