{"action":"created","issue":{"url":"https://api.github.com/repos/globalize/globalize/issues/423","labels_url":"https://api.github.com/repos/globalize/globalize/issues/423/labels{/name}","comments_url":"https://api.github.com/repos/globalize/globalize/issues/423/comments","events_url":"https://api.github.com/repos/globalize/globalize/issues/423/events","html_url":"https://github.com/globalize/globalize/issues/423","id":58571522,"number":423,"title":"#find_by_attribute_name returns nil and produces weird SQL statement","user":{"login":"dasnotme","id":468840,"avatar_url":"https://avatars.githubusercontent.com/u/468840?v=3","gravatar_id":"","url":"https://api.github.com/users/dasnotme","html_url":"https://github.com/dasnotme","followers_url":"https://api.github.com/users/dasnotme/followers","following_url":"https://api.github.com/users/dasnotme/following{/other_user}","gists_url":"https://api.github.com/users/dasnotme/gists{/gist_id}","starred_url":"https://api.github.com/users/dasnotme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasnotme/subscriptions","organizations_url":"https://api.github.com/users/dasnotme/orgs","repos_url":"https://api.github.com/users/dasnotme/repos","events_url":"https://api.github.com/users/dasnotme/events{/privacy}","received_events_url":"https://api.github.com/users/dasnotme/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-23T11:03:34Z","updated_at":"2015-02-23T23:04:09Z","closed_at":"2015-02-23T19:21:00Z","body":"Calling `#find_by_attribute_name` on translated object produces following output:\r\n\r\n```\r\n2.2.0 :001 > Place.find_by_name 'London'\r\n\r\n  Place Load (4.0ms)  SELECT  `places`.* FROM `places` INNER JOIN `place_translations` ON `place_translations`.`place_id` = `places`.`id` WHERE `place_translations`.`name` = '--- !ruby/object:ActiveRecord::StatementCache::Substitute {}\\n' AND `place_translations`.`locale` = 'de' LIMIT 1\r\n => nil\r\n\r\n2.2.0 :002 > Place.where(name: 'London').first\r\n\r\n  Place Load (4.0ms)  SELECT  `places`.* FROM `places` INNER JOIN `place_translations` ON `place_translations`.`place_id` = `places`.`id` WHERE `place_translations`.`name` = 'London' AND `place_translations`.`locale` IN ('en', 'de')  ORDER BY `places`.`id` ASC LIMIT 1\r\n  Place::Translation Load (0.4ms)  SELECT `place_translations`.* FROM `place_translations` WHERE `place_translations`.`place_id` IN (1)\r\n => #<Place id: 1, name: \"London\", created_at: \"2013-04-04 09:48:42\", updated_at: \"2015-02-23 11:51:41\"> \r\n```\r\n\r\n* ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]\r\n* rails 4.2.0\r\n* globalize 5.0.1\r\n"},"comment":{"url":"https://api.github.com/repos/globalize/globalize/issues/comments/75657408","html_url":"https://github.com/globalize/globalize/issues/423#issuecomment-75657408","issue_url":"https://api.github.com/repos/globalize/globalize/issues/423","id":75657408,"user":{"login":"parndt","id":10128,"avatar_url":"https://avatars.githubusercontent.com/u/10128?v=3","gravatar_id":"","url":"https://api.github.com/users/parndt","html_url":"https://github.com/parndt","followers_url":"https://api.github.com/users/parndt/followers","following_url":"https://api.github.com/users/parndt/following{/other_user}","gists_url":"https://api.github.com/users/parndt/gists{/gist_id}","starred_url":"https://api.github.com/users/parndt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parndt/subscriptions","organizations_url":"https://api.github.com/users/parndt/orgs","repos_url":"https://api.github.com/users/parndt/repos","events_url":"https://api.github.com/users/parndt/events{/privacy}","received_events_url":"https://api.github.com/users/parndt/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T23:04:09Z","updated_at":"2015-02-23T23:04:09Z","body":"@shioyama oh you're right!"}}