Moment.js is a fantastic time & date library with lots of great features and utilities. However, if you are working on a performance sensitive web application, it might cause a...
Problem user_name = "I'm Tony" User.where("name like '%#{user_name}%'") # => SELECT `users`.* FROM `users` WHERE (name like '%I'm Tony%') => ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax;...
For all environment
Set authentication in ApplicationController
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
http_basic_authenticate_with name: 'username', password: 'password'
end