$ rails g model User
belongs_to
has_one
# Permissions cheatsheet | |
`chmod [a]bcd` | |
* bit a — sticky:1/setgid:2/setuid:4 (optional, default: 0) | |
* bit b — owner | x:1/w:2/r:4 - xw:3/xr:5/wr:6/xwr:7 | |
* bit c — group | x:1/w:2/r:4 - xw:3/xr:5/wr:6/xwr:7 | |
* bit d — everyone | x:1/w:2/r:4 - xw:3/xr:5/wr:6/xwr:7 | |
note: only file/dir owner can chmod it |
class ApplicationController < ActionController::Base | |
include Pundit | |
# Verify that controller actions are authorized. Optional, but good. | |
after_filter :verify_authorized, except: :index | |
after_filter :verify_policy_scoped, only: :index | |
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized | |
private |
If the namespace is not used then the commands will perform on top of the default database.
bundle exec rake db:create
bundle exec rake db:migrate
By using the namespace we are going to use all the configuration for our alternate DB.
bundle exec rake store:db:create
bundle exec rake store:db:migrate
require 'csv' | |
@servers =["server_ip1","server_ip2", "server_ip3"] | |
list = {} | |
host = [] | |
result = {} | |
CSV.foreach("mx_records.csv") do |row| | |