Skip to content

Instantly share code, notes, and snippets.

@Edouard-chin
Edouard-chin / test_case.rb
Created October 18, 2018 03:38
State machine initial state broken after rails/rails@366e7e3
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails"
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'activerecord', github: 'rails/rails'
@Edouard-chin
Edouard-chin / bug_report.rb
Created March 19, 2019 15:48
Bootsnap autoload
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'bootsnap', '~> 1.4.1'
gem 'activesupport'
end
require 'bootsnap'
@Edouard-chin
Edouard-chin / bla.rb
Created April 25, 2019 12:36
bundler patch
if ENV['SHOPIFY_NEXT']
# monkey patching to support dual booting
module Bundler::SharedHelpers
def default_lockfile=(path)
@default_lockfile = path
end
def default_lockfile
@default_lockfile ||= Pathname.new("#{default_gemfile}.lock")
end
end
# frozen_string_literal: true
require 'psych'
class Foo
def value
return @value if defined?(@value)
@value = {
fix_encoding('foo') => fix_encoding('a' * 24),
@Edouard-chin
Edouard-chin / bug_report_commit_orders.rb
Created May 7, 2019 13:40
after_commit callback order not respected
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: 'rails/rails', ref: 'b1553fc45f'
@Edouard-chin
Edouard-chin / bug_report.rb
Created June 18, 2019 21:06
Reorder SQL difference
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@Edouard-chin
Edouard-chin / bug_report.rb
Created December 10, 2019 20:00
Through association preloading doesn't work
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
gem "rails", '~> 6.0.0'
gem "sqlite3"
end
require "active_record"
@Edouard-chin
Edouard-chin / bug.rb
Last active May 25, 2020 15:12
Preload polymorphic association with scope
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "sqlite3"
gem 'activerecord', github: 'rails/rails', ref: ENV['REF']