lib/fourchette/pgbackups.rb in fourchette-0.1.3 vs lib/fourchette/pgbackups.rb in fourchette-0.1.4
- old
+ new
@@ -18,19 +18,19 @@
end
private
def ensure_pgbackups_is_present(heroku_app_name)
- unless existing_backups?
+ unless existing_backups?(heroku_app_name)
logger.info "Adding pgbackups to #{heroku_app_name}"
@heroku.client.addon.create(heroku_app_name, { plan: 'pgbackups' })
end
end
- def existing_backups?
- @heroku.client.addon.list(heroku_app_name).select do |addon|
+ def existing_backups?(heroku_app_name)
+ @heroku.client.addon.list(heroku_app_name).any? do |addon|
addon['name'] == 'pgbackups'
- end.any?
+ end
end
def pg_details_for(app_name)
@heroku.config_vars(app_name).each do |key, value|
if key.start_with?('HEROKU_POSTGRESQL_') && key.end_with?('_URL')