Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Heroku API request #4

Open
tmaier opened this issue Jan 3, 2014 · 0 comments
Open

Better Heroku API request #4

tmaier opened this issue Jan 3, 2014 · 0 comments

Comments

@tmaier
Copy link

tmaier commented Jan 3, 2014

Hi @n8,

thank you for the idea to take the heroku version into account.
I came up with a slightly improved API call, which just returns the current release and not all of them.

  ENV['ETAG_VERSION_ID'] =
    Heroku::API.new(api_key: Figaro.env.heroku_api_key)
      .get_release(Figaro.env.heroku_app, :current)
      .body['name']

I also want to note, that this gem might be obsolete with Rails 4.
Rails 4 introduced controller-wide ETags.

class ApplicationController < ActionController::Base
  etag { ENV['ETAG_VERSION_ID'] }

  # ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant