Last active
December 30, 2021 19:02
-
-
Save rylwin/d6e297a5e5bd7a532c3e772eac948e0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
gem "activerecord", "~> 7.0.0" | |
gem "sqlite3" | |
end | |
require "active_record" | |
require "minitest/autorun" | |
require "logger" | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection( | |
adapter: "sqlite3", | |
database: ":memory:", | |
) | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do | |
create_table :records, force: true do |t| | |
end | |
create_table :entries, force: true do |t| | |
t.integer :record_id | |
end | |
create_table :details, force: true do |t| | |
t.integer :entry_id | |
end | |
end | |
class Record < ActiveRecord::Base | |
has_many :entries | |
end | |
class Entry < ActiveRecord::Base | |
belongs_to :record | |
has_one :detail | |
end | |
class Detail < ActiveRecord::Base | |
belongs_to :entry | |
end | |
class BugTest < Minitest::Test | |
def test_association_stuff | |
Entry.create(record: Record.new, detail: Detail.new) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Error: | |
BugTest#test_association_stuff: | |
ArgumentError: wrong number of arguments (given 3, expected 0) | |
.../activerecord-7.0.0/lib/active_record/associations/builder/belongs_to.rb:132:in `record_changed?' | |
.../activerecord-7.0.0/lib/active_record/autosave_association.rb:449:in `save_has_one_association' | |
.../activerecord-7.0.0/lib/active_record/autosave_association.rb:198:in `block in add_autosave_association_callbacks' | |
.../activerecord-7.0.0/lib/active_record/autosave_association.rb:166:in `instance_eval' | |
.../activerecord-7.0.0/lib/active_record/autosave_association.rb:166:in `block in define_non_cyclic_method' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:400:in `block in make_lambda' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:236:in `block in halting_and_conditional' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:599:in `block in invoke_after' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:599:in `each' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:599:in `invoke_after' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:108:in `run_callbacks' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:929:in `_run_create_callbacks' | |
.../activerecord-7.0.0/lib/active_record/callbacks.rb:461:in `_create_record' | |
.../activerecord-7.0.0/lib/active_record/timestamp.rb:108:in `_create_record' | |
.../activerecord-7.0.0/lib/active_record/persistence.rb:1066:in `create_or_update' | |
.../activerecord-7.0.0/lib/active_record/callbacks.rb:457:in `block in create_or_update' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:107:in `run_callbacks' | |
.../activesupport-7.0.0/lib/active_support/callbacks.rb:929:in `_run_save_callbacks' | |
.../activerecord-7.0.0/lib/active_record/callbacks.rb:457:in `create_or_update' | |
.../activerecord-7.0.0/lib/active_record/timestamp.rb:126:in `create_or_update' | |
.../activerecord-7.0.0/lib/active_record/persistence.rb:616:in `save' | |
.../activerecord-7.0.0/lib/active_record/validations.rb:47:in `save' | |
.../activerecord-7.0.0/lib/active_record/transactions.rb:298:in `block in save' | |
.../activerecord-7.0.0/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status' | |
.../activerecord-7.0.0/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction' | |
.../activesupport-7.0.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt' | |
.../activesupport-7.0.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize' | |
.../activesupport-7.0.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt' | |
.../activesupport-7.0.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize' | |
.../activerecord-7.0.0/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction' | |
.../activerecord-7.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction' | |
.../activerecord-7.0.0/lib/active_record/transactions.rb:350:in `with_transaction_returning_status' | |
.../activerecord-7.0.0/lib/active_record/transactions.rb:298:in `save' | |
.../activerecord-7.0.0/lib/active_record/suppressor.rb:50:in `save' | |
.../activerecord-7.0.0/lib/active_record/persistence.rb:38:in `create' | |
belongs_to_change_tracking_method_name_conflict.rb:52:in `test_association_stuff' | |
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment