{"action":"created","issue":{"url":"https://api.github.com/repos/alexreisner/geocoder/issues/746","labels_url":"https://api.github.com/repos/alexreisner/geocoder/issues/746/labels{/name}","comments_url":"https://api.github.com/repos/alexreisner/geocoder/issues/746/comments","events_url":"https://api.github.com/repos/alexreisner/geocoder/issues/746/events","html_url":"https://github.com/alexreisner/geocoder/pull/746","id":48202067,"number":746,"title":"Geocoder fallback","user":{"login":"rob-murray","id":1809160,"avatar_url":"https://avatars.githubusercontent.com/u/1809160?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-murray","html_url":"https://github.com/rob-murray","followers_url":"https://api.github.com/users/rob-murray/followers","following_url":"https://api.github.com/users/rob-murray/following{/other_user}","gists_url":"https://api.github.com/users/rob-murray/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-murray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-murray/subscriptions","organizations_url":"https://api.github.com/users/rob-murray/orgs","repos_url":"https://api.github.com/users/rob-murray/repos","events_url":"https://api.github.com/users/rob-murray/events{/privacy}","received_events_url":"https://api.github.com/users/rob-murray/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alexreisner/geocoder/labels/feature","name":"feature","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-11-09T14:02:05Z","updated_at":"2015-12-22T13:55:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alexreisner/geocoder/pulls/746","html_url":"https://github.com/alexreisner/geocoder/pull/746","diff_url":"https://github.com/alexreisner/geocoder/pull/746.diff","patch_url":"https://github.com/alexreisner/geocoder/pull/746.patch"},"body":"Hi alex,\r\nI've had another go at implementing fallback options, as discussed in #661 and I have gone with your api - so you can configure fallbacks like this;\r\n\r\n```ruby\r\n:lookup => [\r\n    {\r\n        :name => :yandex,\r\n        :skip => ->(query) { !query.text.match(/russia/i) },\r\n        :failure => ->(results, exception) { exception.class == Geocoder::OverQueryLimitError }\r\n    },\r\n    {\r\n        :name => :google,\r\n        :skip => nil,\r\n        :failure => nil\r\n    }\r\n  ]\r\n```\r\n\r\nIf the fallback options arent specified, ie the `:lookup` is just the symbol then it works as before.\r\n\r\nI am pretty much done, however I have only been testing this locally and not in the real world whereas the changes I had in #661 have been used in real applications for a while.\r\n\r\nAnyway, welcome your thoughts so far.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alexreisner/geocoder/issues/comments/166623448","html_url":"https://github.com/alexreisner/geocoder/pull/746#issuecomment-166623448","issue_url":"https://api.github.com/repos/alexreisner/geocoder/issues/746","id":166623448,"user":{"login":"tmaszk","id":4540522,"avatar_url":"https://avatars.githubusercontent.com/u/4540522?v=3","gravatar_id":"","url":"https://api.github.com/users/tmaszk","html_url":"https://github.com/tmaszk","followers_url":"https://api.github.com/users/tmaszk/followers","following_url":"https://api.github.com/users/tmaszk/following{/other_user}","gists_url":"https://api.github.com/users/tmaszk/gists{/gist_id}","starred_url":"https://api.github.com/users/tmaszk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmaszk/subscriptions","organizations_url":"https://api.github.com/users/tmaszk/orgs","repos_url":"https://api.github.com/users/tmaszk/repos","events_url":"https://api.github.com/users/tmaszk/events{/privacy}","received_events_url":"https://api.github.com/users/tmaszk/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T13:55:22Z","updated_at":"2015-12-22T13:55:22Z","body":"Would love to see this changed merged"}}