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
require 'rails_helper' | |
# This spec was generated by rspec-rails when you ran the scaffold generator. | |
# It demonstrates how one might use RSpec to specify the controller code that | |
# was generated by Rails when you ran the scaffold generator. | |
# | |
# It assumes that the implementation code is generated by the rails scaffold | |
# generator. If you are using any extension libraries to generate different | |
# controller code, this generated spec may or may not pass. | |
# |
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
# PRODUCT MODEL | |
before_create do | |
self.slug = title.downcase.gsub(" ", "-") | |
end | |
def to_param | |
[id, title.parameterize].join("-") | |
end | |
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
bundle exec rake db:drop RAILS_ENV=test # if db already exists | |
bundle exec rake db:create RAILS_ENV=test | |
bundle exec rake db:schema:load RAILS_ENV=test |
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
GOOGLE SETTINGS | |
https://accounts.google.com/DisplayUnlockCaptcha | |
https://www.google.com/settings/security/lesssecureapps |
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
@site_audits = @site_audits.joins(audit_specification: :service_category).where(service_categories: { id: params[:service][:category] }) |
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
tail -f /var/log/nginx/error.log |
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
add_column :users, :admin, :boolean, null: false, default: false |
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
brew info postgresql | |
postgresql: stable 9.3.2 (bottled) | |
http://www.postgresql.org/ | |
Conflicts with: postgres-xc | |
/usr/local/Cellar/postgresql/9.1.5 (2755 files, 37M) | |
Built from source | |
/usr/local/Cellar/postgresql/9.3.2 (2924 files, 39M) * | |
Poured from bottle | |
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/postgresql.rb | |
# … and some more |
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
list = @job.job_status #array | |
list.shift | |
@job.job_status = list | |
@job.job_status_will_change! | |
@job.save! |
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
bundle exec rake stock_update RAILS_ENV=production | |
rails console production |
OlderNewer