aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRob Trame <Redapted@users.noreply.github.com>2019-05-01 13:53:35 -0700
committerRafael França <rafaelmfranca@gmail.com>2019-05-01 15:53:35 -0500
commitf4fd7d1d20dfbc4389435a8f0f153f7960bb1544 (patch)
treef54f9768c049730b19b3c0e5d3ed752f99598950 /activerecord/lib/active_record
parentf8243f81ffc561420c2404cb344f9d9b85b818d7 (diff)
downloadrails-f4fd7d1d20dfbc4389435a8f0f153f7960bb1544.tar.gz
rails-f4fd7d1d20dfbc4389435a8f0f153f7960bb1544.tar.bz2
rails-f4fd7d1d20dfbc4389435a8f0f153f7960bb1544.zip
Make scope arity check consistent (#36134)
* Make scope arity check consistent * Add test for arity change [Rob Trame + Rafael Mendonça França]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/reflection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 1312bf6f91..eefda2b8f4 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -477,7 +477,7 @@ module ActiveRecord
def check_preloadable!
return unless scope
- if scope.arity > 0
+ unless scope.arity == 0
raise ArgumentError, <<-MSG.squish
The association scope '#{name}' is instance dependent (the scope
block takes an argument). Preloading instance dependent scopes is