Closed issei-m closed 3 months ago
@flavorjones ugh. we may need to check active record version when calling super
It sure gets tricky to support multiple versions of active record since the interfaces change over time.
To fix this, we'll probably need to conditionally define (or call) methods based upon the active record version.
I have created a PR that may solve this issue. https://github.com/active-hash/active_hash/pull/306
Closed by #306
This PR introduces a new extension method
has_many
that overrides the one fromActiveRecord::Base
, but they have a different argument signature, so the following code raises an error:I'm passing three arguments to this
has_many
according to the original ActiveRecord's method signature:https://github.com/rails/rails/blob/v7.1.3.2/activerecord/lib/active_record/associations.rb#L1522
but extended one accepts only two:
https://github.com/active-hash/active_hash/blob/v3.3.0/lib/associations/associations.rb#L9
Any idea to resolve it? I'm using Rails 7.1.3.