Only merge scopes with zero arity in has_many through

with dynamic conditions.

Fixes #16128

This bug was introduced in https://github.com/rails/rails/commit/c35e438620f2d56562251571377995359546393d
so it's present from 4.1.2-rc1 and after.

https://github.com/rails/rails/commit/c35e438620f2d56562251571377995359546393d
merges any relation scopes passed as proc objects to the relation,
but does *not* take into account the arity of the lambda.

To reproduce: https://gist.github.com/Agis-/5f1f0d664d2cd08dfb9b
Deprecated .deliver / .deliver! to .deliver_now / .deliver_now!
Updated rdoc / guides / release notes related to ActiveJob / ActionMailer
Require ActiveJob in case a skip_xxx option is given

Change position of require active_job
Merge pull request #16585 from nicolasblanco/require_active_job

Require ActiveJob in case a skip_xxx option is given
Merge pull request #16582 from cristianbica/actionmailer-deprecate-deliver

Deprecated ActionMailer .deliver and updated ActionMailer / ActiveJob docs/guide
Fix typo in rdoc [ci skip]
Merge pull request #16586 from seuros/master

Fix typo in rdoc [ci skip]
Merge pull request #16172 from Agis-/hmt_scope_arity

has_many :through with dynamic condition merging
[Rdoc] Make clear that we are sending an AR object [ci skip]
Merge pull request #16587 from seuros/master

[Rdoc] Make clear that we are sending an AR object [ci skip]
Point release notes to stable branch for list of commits. [ci skip]
Same as f39cb2b except backport friendly

Point release notes to stable branch for list of commits. [ci skip]
Same as f39cb2b except backport friendly

Point release notes to stable branch for list of commits. [ci skip]