First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
See Amazon tutorial: Getting Started with Amazon EC2 Linux Instances
See Amazon tutorial: Installing a LAMP Web Server on Amazon Linux
# for redirecting hhtp traffic to https version of the site | |
server { | |
listen 80; | |
server_name example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
# for redirecting to non-www version of the site | |
server { | |
listen 80; |
$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
# Traversing arrays and objects in CoffeeScript | |
# The array and object we use for testing | |
arr = [1, 2, 3, 4, 5] | |
obj = {a: 1, b: 2, c: 3, d: 4, e: 5} | |
# 'in' has a different meaning in CoffeeScript than in JavaScript | |
# CS: element in array -> JS: array.indexOf(element) >= 0 | |
console.log '5 in arr: ' + (5 in arr) |
Rails.application.eager_load! | |
unused_routes = {} | |
# Iterating over all non-empty routes from RouteSet | |
Rails.application.routes.routes.map(&:requirements).reject(&:empty?).each do |route| | |
name = route[:controller].camelcase | |
next if name.start_with?("Rails") | |
controller = "#{name}Controller" |
Check requirements at https://pgmodeler.io/installation.
You will need Qt 5.9.x installed, full XCode installed, and homebrew installation of postgres and openssl.
The example below is v10.5 of PG and v5.9.6 of Qt, modify accordingly. Also, replace {{USERNAME}}
with you Mac username.
The installation is the same as the instructions at the link above. There are a few path differences due to homebrew installation locations.
Rails 5.0 Rails 5.1+ changed? → saved_change_to? _was → _before_last_save changed? → saved_changes? changed_attributes → saved_changes.transform_values(&:first)
Model callbacks behavior After Rails 4.x release, some changes were made on callbacks to split update on the model before and after writing data to the database. We had to be careful to use the correct helpers: _changed? for after_save callbacks, and previous_changes[:] for after_commit callbacks: