A simple solution to an annoying problem!
# Rakefile task "assets:precompile" => "db:migrate" if ENV['MIGRATE_ON_PRECOMPILE'] # run to enable heroku config:set MIGRATE_ON_PRECOMPILE=1
A simple solution to an annoying problem!
# Rakefile task "assets:precompile" => "db:migrate" if ENV['MIGRATE_ON_PRECOMPILE'] # run to enable heroku config:set MIGRATE_ON_PRECOMPILE=1
Did you also try the following? It adds a dependency between the tasks, if you the ENV var is set. Might be cleaner than starting a new command.
# Rakefile
if ENV[‘MIGRATE_ON_PRECOMPILE’]
task “assets:precompile” => “rake db:migrate”
end
Thx, yes it’s much clearer! … I wanted to have an extra puts in there for clarity, but I guess having the ENV var is pretty obvious.