basecamp / basecamp/activerecord-tenanted
Rails type_for_column no longer takes a connection.
- 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
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