Skip to content

Instantly share code, notes, and snippets.

View lgebhardt's full-sized avatar

Larry Gebhardt lgebhardt

  • Cerebris Corporation
  • NH
View GitHub Profile

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@lgebhardt
lgebhardt / case_test_case.rb
Created November 26, 2019 13:19
JR Test of using a model named `case`
begin
require 'bundler/inline'
require 'bundler'
rescue LoadError => e
STDERR.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true, ui: ENV['SILENT'] ? Bundler::UI::Silent.new : Bundler::UI::Shell.new) do
source 'https://rubygems.org'