defunkt (owner)

Forks

Revisions

gist: 80097 Download_button fork
public
Public Clone URL: git://gist.github.com/80097.git
Embed All Files: show embed
config/environments/production.rb #
1
2
3
4
5
6
7
# version 2.0 of http://ozmm.org/posts/easy_rails_asset_ids_with_git.html
 
repo = Grit::Repo.new('/path/to/your/app/shared/cached-copy')
js = repo.log('deploy', 'public/javascripts', :max_count => 1).first
css = repo.log('deploy', 'public/stylesheets', :max_count => 1).first
 
ENV['RAILS_ASSET_ID'] = js.committed_date > css.committed_date ? js.id : css.id