Installing mysql2
gem errors on MacOS Catalina with MySQL 5.7.
Make sure openssl
is installed on Mac via Homebrew.
brew install openssl
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
warn 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', '~> 5.2' |
gem "phonelib" |
require_relative "customer" | |
require_relative "user" | |
# context bind role to object. | |
# by using the extend method in ruby. | |
# now the data object has some behaviors that get from the role class(Customer). | |
class Context | |
def initialize(user, book) | |
@customer, @book = user, book | |
@customer.extend(Customer) |
brew tap homebrew/versions | |
brew install v8-315 | |
gem install libv8 -v '3.16.14.13' -- --with-system-v8 | |
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 | |
bundle install |
This guide assumes that you recently run brew upgrade postgresql
and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.
First let's check something.
brew info postgresql
The top of what gets printed as a result is the most important:
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que | |
- Model Student and model Teacher are both STI models with super class model User | |
- Model Story is a STI model with super class model Task | |
- includes() and joins(), both fails | |
Rails alias naming convention (includes() and joins()) | |
- One model as parameter | |
- is base model (includes(:users)) |
# DCI EXAMPLE IN RUBY (with some prototype elements) | |
# Blog post: https://www.ludyna.com/oleh/dci-example-in-ruby | |
# | |
# More info: | |
# | |
# Creator of MVC & DCI, Trygve Reenskaug: DCI: Re-thinking the foundations of | |
# object orientation and of programming | |
# http://vimeo.com/8235394 | |
# | |
# James Coplien: Why DCI is the Right Architecture for Right Now |