{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/smart-answers/issues/2412","repository_url":"https://api.github.com/repos/alphagov/smart-answers","labels_url":"https://api.github.com/repos/alphagov/smart-answers/issues/2412/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/smart-answers/issues/2412/comments","events_url":"https://api.github.com/repos/alphagov/smart-answers/issues/2412/events","html_url":"https://github.com/alphagov/smart-answers/pull/2412","id":144509974,"number":2412,"title":"Allow `RatesQuery` date to be set using environment variable","user":{"login":"chrisroos","id":6556,"avatar_url":"https://avatars.githubusercontent.com/u/6556?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisroos","html_url":"https://github.com/chrisroos","followers_url":"https://api.github.com/users/chrisroos/followers","following_url":"https://api.github.com/users/chrisroos/following{/other_user}","gists_url":"https://api.github.com/users/chrisroos/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisroos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisroos/subscriptions","organizations_url":"https://api.github.com/users/chrisroos/orgs","repos_url":"https://api.github.com/users/chrisroos/repos","events_url":"https://api.github.com/users/chrisroos/events{/privacy}","received_events_url":"https://api.github.com/users/chrisroos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alphagov/smart-answers/labels/LGTM","name":"LGTM","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"ikennaokpala","id":84896,"avatar_url":"https://avatars.githubusercontent.com/u/84896?v=3","gravatar_id":"","url":"https://api.github.com/users/ikennaokpala","html_url":"https://github.com/ikennaokpala","followers_url":"https://api.github.com/users/ikennaokpala/followers","following_url":"https://api.github.com/users/ikennaokpala/following{/other_user}","gists_url":"https://api.github.com/users/ikennaokpala/gists{/gist_id}","starred_url":"https://api.github.com/users/ikennaokpala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikennaokpala/subscriptions","organizations_url":"https://api.github.com/users/ikennaokpala/orgs","repos_url":"https://api.github.com/users/ikennaokpala/repos","events_url":"https://api.github.com/users/ikennaokpala/events{/privacy}","received_events_url":"https://api.github.com/users/ikennaokpala/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-03-30T08:59:01Z","updated_at":"2016-03-31T22:49:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/smart-answers/pulls/2412","html_url":"https://github.com/alphagov/smart-answers/pull/2412","diff_url":"https://github.com/alphagov/smart-answers/pull/2412.diff","patch_url":"https://github.com/alphagov/smart-answers/pull/2412.patch"},"body":"This will allow us to deploy rates changes to Heroku and ask someone from the content team/department to factcheck the changes. This was previously hard because the `RatesQuery` defaulted to today's date.\r\n\r\nThis was [suggested by @floehopper in a comment on the Trello card about updating the rates for register-a-birth][trello-comment].\r\n\r\nI tested that this was working as expected by setting the `RATES_QUERY_DATE` environment variable and viewing an outcome for the register-a-birth Smart Answer.\r\n\r\n## Before\r\n\r\n    $ rails s\r\n    $ open http://localhost:3000/register-a-birth/y/afghanistan/mother/yes/same_country#pay\r\n\r\n![pr-2412-before](https://cloud.githubusercontent.com/assets/6556/14137089/a928920a-f6c2-11e5-9ddb-76b768f2495d.png)\r\n\r\nObserve that it's displaying the latest rates available in [births_and_deaths_document_return_fees.yml][births-and-deaths-rates].\r\n\r\n## After\r\n\r\n    $ RATES_QUERY_DATE=2015-07-30 rails s\r\n    $ open http://localhost:3000/register-a-birth/y/afghanistan/mother/yes/same_country#pay\r\n\r\n![pr-2412-after](https://cloud.githubusercontent.com/assets/6556/14137095/ad56a6aa-f6c2-11e5-9705-5371f88823d3.png)\r\n\r\nObserve that it's displaying the earlier rates available in [births_and_deaths_document_return_fees.yml][births-and-deaths-rates].\r\n\r\n[births-and-deaths-rates]: https://github.com/alphagov/smart-answers/blob/master/lib/data/rates/births_and_deaths_document_return_fees.yml\r\n[trello-comment]: https://trello.com/c/NNHVAmHF/72-register-a-birth-abroad-update-to-fees-on-6-april-2016-content-change-request#comment-56fa5dc838521db45b367f6f"},"comment":{"url":"https://api.github.com/repos/alphagov/smart-answers/issues/comments/204162408","html_url":"https://github.com/alphagov/smart-answers/pull/2412#issuecomment-204162408","issue_url":"https://api.github.com/repos/alphagov/smart-answers/issues/2412","id":204162408,"user":{"login":"chrisroos","id":6556,"avatar_url":"https://avatars.githubusercontent.com/u/6556?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisroos","html_url":"https://github.com/chrisroos","followers_url":"https://api.github.com/users/chrisroos/followers","following_url":"https://api.github.com/users/chrisroos/following{/other_user}","gists_url":"https://api.github.com/users/chrisroos/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisroos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisroos/subscriptions","organizations_url":"https://api.github.com/users/chrisroos/orgs","repos_url":"https://api.github.com/users/chrisroos/repos","events_url":"https://api.github.com/users/chrisroos/events{/privacy}","received_events_url":"https://api.github.com/users/chrisroos/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T22:49:44Z","updated_at":"2016-03-31T22:49:44Z","body":"Thanks, @ikennaokpala!\r\n\r\n> I suppose one would have to update this (RATES_QUERY_DATE) manually on heroku for factcheck..\r\n\r\nThat's correct. You've reminded me that I should update the docs to explain how to do this. I'll do that as part of this branch and then get this merged."}}