basecamp / basecamp/activerecord-tenanted

Rails type_for_column no longer takes a connection.

Open
#279 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
617
Forks
29
PR merge metrics
No merged PRs in 30d

Description

https://github.com/basecamp/activerecord-tenanted/blob/1e92cb34d0b7b02875040826330c1918abb06e9d/lib/active_record/tenanted/patches.rb#L38

Here we are setting a nil_connection but now rails no longer accepts a connection.
This will break the upgrade path.

```
ArgumentError: wrong number of arguments (given 2, expected 1)
/Users/lluarte/.local/share/mise/installs/ruby/3.4.7/lib/ruby/gems/3.4.0/bundler/gems/rails-76fcc3a31daf/activerecord/lib/active_record/attributes.rb:311:in 'type_for_column'
/Users/lluarte/.local/share/mise/installs/ruby/3.4.7/lib/ruby/gems/3.4.0/bundler/gems/activerecord-tenanted-855379f55d79/lib/active_record/tenanted/patches.rb:38:in 'block in ActiveRecord::Tenanted::Patches::Attributes::ClassMethods#_default_attributes'
```

Contributor guide

Open the contributing guide

Research direction

Start at lib/active_record/tenanted/patches.rb#L38 and compare its type_for_column call with the Rails ActiveRecord code at attributes.rb:311 shown in the stack trace. Reproduce the ArgumentError on the upgrade path, then verify that the compatibility behavior works with Rails' current signature and that the error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.