Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryuta Kamizono kamipo

View GitHub Profile
View attribute_benchmark.rb
# 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"
View gist:7806543df5917b08bd598b9d884aa93a
```bash
brew install postgresql
pg_config
mkdir -p /usr/local/var/postgres
initdb /usr/local/var/postgres -E utf8
vi /usr/local/var/postgres/postgresql.conf
View gist:7ed4ee23a8c879d68bc7c7acc02f43f4
test_run_in_parallel_with_unmarshable_exception
test_run_in_parallel_with_unknown_object
% bin/test test/application/test_runner_test.rb -n test_run_in_parallel_with_unknown_object
View transaction_memory_usage.rb
# 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"
View undef.rb
puts RUBY_VERSION
module Rails
end
def Rails.root; :defined_root end
p defined?(Rails.root)
Rails.instance_eval { undef :root }
View assign_attributes_benchmark.rb
# 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"
View kwargs.rb
class Foo
def initialize(target)
@target = target
end
if RUBY_VERSION > "2.7"
def method_missing(method, *args, **kwargs, &block)
@target.send(method, *args, **kwargs, &block)
end
else
View lock.rb
# frozen_string_literal: true
require "mysql2"
def client
Mysql2::Client.new(
host: "localhost",
username: "root",
database: "test",
)
View environment.rb
# Load the Rails application.
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
ActiveRecord::SchemaDumper.ignore_tables << %r{
\A (?:
_ # initials _
| test_ # for testing
View test_includes.diff
diff --git a/activerecord/test/cases/associations/inner_join_association_test.rb b/activerecord/test/cases/associations/inner_join_association_test.rb
index e0dac01f4a..ebba6b28b7 100644
--- a/activerecord/test/cases/associations/inner_join_association_test.rb
+++ b/activerecord/test/cases/associations/inner_join_association_test.rb
@@ -13,7 +13,18 @@
class InnerJoinAssociationTest < ActiveRecord::TestCase
fixtures :authors, :author_addresses, :essays, :posts, :comments, :categories, :categories_posts, :categorizations,
- :taggings, :tags
+ :taggings, :tags, :people
You can’t perform that action at this time.