aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/finder_methods.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-06-13 11:03:38 -0400
committerGitHub <noreply@github.com>2016-06-13 11:03:38 -0400
commit1efc81ba8fe27e406bdb2de104234253b47ddc2f (patch)
tree6f376f8d6a19a594c7c3c1381cc465e909c4db8d /activerecord/lib/active_record/relation/finder_methods.rb
parent1f131fba4cf9497ee0c54bb4a51fd86ec76b76a4 (diff)
parent681a0a0299500024635e790c1ceb2da281652444 (diff)
downloadrails-1efc81ba8fe27e406bdb2de104234253b47ddc2f.tar.gz
rails-1efc81ba8fe27e406bdb2de104234253b47ddc2f.tar.bz2
rails-1efc81ba8fe27e406bdb2de104234253b47ddc2f.zip
Merge pull request #25374 from kamipo/fix_calculate_with_string_in_from_and_eager_loading
Fix `calculate` with a string value in `from` and eager loading
Diffstat (limited to 'activerecord/lib/active_record/relation/finder_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 87eea8277a..882605de31 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -398,15 +398,7 @@ module ActiveRecord
end
def construct_relation_for_association_calculations
- from = arel.froms.first
- if Arel::Table === from
- apply_join_dependency(self, construct_join_dependency(joins_values))
- else
- # FIXME: as far as I can tell, `from` will always be an Arel::Table.
- # There are no tests that test this branch, but presumably it's
- # possible for `from` to be a list?
- apply_join_dependency(self, construct_join_dependency(from))
- end
+ apply_join_dependency(self, construct_join_dependency(joins_values))
end
def apply_join_dependency(relation, join_dependency)