diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-07-24 14:50:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 14:50:14 -0400 |
commit | 06dff4d7da6bfec842e94e1585cd1af9d048e6a4 (patch) | |
tree | 8e24fef4737eb2c95dc2c94020cdf3fa93983727 /activerecord/lib/active_record/relation.rb | |
parent | 3a4a775732a0512d5ef0c97c2bbeb03110766715 (diff) | |
parent | 3293ca6d38b42582c95ae7f6eaf6c0bd8eef2d65 (diff) | |
download | rails-06dff4d7da6bfec842e94e1585cd1af9d048e6a4.tar.gz rails-06dff4d7da6bfec842e94e1585cd1af9d048e6a4.tar.bz2 rails-06dff4d7da6bfec842e94e1585cd1af9d048e6a4.zip |
Merge pull request #29848 from kamipo/fix_distinct_count_with_order_and_limit
Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT`
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 92ecdcae92..1c4011b75e 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -642,6 +642,10 @@ module ActiveRecord @values == klass.unscoped.values end + def has_limit_or_offset? # :nodoc: + limit_value || offset_value + end + protected def load_records(records) |