This file contains hidden or 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
class Program < ActiveRecord::Base | |
belongs_to :associated_school | |
scope :active, -> { where("active = ?", true) } | |
scope :inactive, -> { where("active = ?", false)} | |
scope :in_country, ->(country) { | |
joins(associated_school: | |
{school: :address} | |
).where(addresses: |
This file contains hidden or 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
namespace :unicorn do | |
desc "Zero-downtime restart of Unicorn" | |
task :restart, :except => { :no_release => true } do | |
# you can use this signal if preload_app == false | |
# run "kill -s HUP `cat #{shared_path}/pids/unicorn.pid`" | |
# use this signal if preload_app == true | |
run "kill -s USR2 `cat #{shared_path}/pids/unicorn.pid`" | |
# give unicorn some seconds to create unicorn.pid.oldbin |
NewerOlder