Skip to content

Commit

Permalink
Misc fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
benubois committed Sep 20, 2016
1 parent f0f9d5e commit 3a100b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/initializers/new_framework_defaults.rb
Expand Up @@ -20,4 +20,4 @@
Rails.application.config.active_record.belongs_to_required_by_default = false

# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = true
ActiveSupport.halt_callback_chains_on_return_false = false
5 changes: 4 additions & 1 deletion lib/tasks/feedbin_reset.rake
@@ -1,10 +1,13 @@
namespace :feedbin do
desc "run db:reset, flush redis and restart pow"
task :reset do
db_name = "#{File.basename(Rails.root)}_#{Rails.env}"
sh = "ps xa | grep postgres: | grep #{db_name} | grep -v grep | awk '{print $1}' | xargs kill"
puts `#{sh}`

FileUtils.mkdir_p(File.join(Rails.root, 'tmp'))
restart_file = File.join(Rails.root, 'tmp', 'restart.txt')
Kernel.system "touch #{restart_file}"
Kernel.system "rake --trace db:drop"
Kernel.system "rake --trace db:reset"
Kernel.system "redis-cli 'flushdb'"
Kernel.system "redis-cli -n 2 'flushdb'"
Expand Down
8 changes: 0 additions & 8 deletions lib/tasks/kill_postgres_connections.rake

This file was deleted.

0 comments on commit 3a100b5

Please sign in to comment.