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
1.DRY - Dont' Repeat Yourself | |
2.Two spaces, no tabs | |
3.Boolean Tests: don't use "and" and "or", always use "&&" and "||" | |
Comments | |
-------- | |
1.Remove old commented code | |
2."How to" comments - If you add/change any method/variables etc.., always add detailed description in just above line. So, anybody can understand that code. | |
Camels for Classes, Snakes Everywhere Else |
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
#! /bin/sh | |
set_path="cd APP_FULL_PATH" | |
case "$1" in | |
start) | |
echo -n "Starting delayed_job: " | |
su - imdeploy -c "$set_path; RAILS_ENV=production script/delayed_job start" >> /var/log/delayed_job.log 2>&1 | |
echo "done." ;; | |
stop) echo -n "Stopping delayed_job: " | |
su - imdeploy -c "$set_path; RAILS_ENV=production script/delayed_job stop" >> /var/log/delayed_job.log 2>&1 | |
echo "done." ;; |
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
check process delayed_job | |
with pidfile /home/USER_NAM/APP_NAME/shared/pids/delayed_job.pid | |
start program = “/usr/bin/env RAILS_ENV=production /home/USER_NAM/APP_NAME/current/script/delayed_job start” | |
stop program = “/usr/bin/env RAILS_ENV=production /home/USER_NAM/APP_NAME/current/script/delayed_job stop” |
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
ActiveRecord::Base.connection.tables.map do |model| | |
unless ['schema_migrations', 'cic_user_profiles'].include?(model) | |
klass = model.capitalize.singularize.camelize.constantize | |
puts "Deleting #{klass}" | |
klass.delete_all | |
end | |
end |
NewerOlder