Created
August 27, 2011 13:03
-
-
Save mutle/1175364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# no maint page unless migrations are required | |
def conditionally_enable_maintenance_page | |
if c.migrate? | |
info "~> testing necessity for migrations & maintenance page" | |
if `cd #{c.release_path} && bundle exec rake db:migrate:status | grep down | wc -l`.to_i > 0 | |
info "~> migrations pending, maintenance page required" | |
super | |
else | |
info "~> no migrations pending, maintenance page not required, migration command cancelled" | |
@cancel_migrations = true | |
end | |
end | |
end | |
def migrate | |
return if @cancel_migrations | |
super | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment