Skip to content

Instantly share code, notes, and snippets.

@Edouard-chin
Edouard-chin / bug_report.rb
Created June 17, 2020 15:05
RouteSet generate extras for json requests
# 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 "rails", github: 'rails/rails'
@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']
@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_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_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'
# 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 / 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
@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'
# 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'