diff options
Diffstat (limited to 'lib/arel/relations/operations')
-rw-r--r-- | lib/arel/relations/operations/group.rb | 2 | ||||
-rw-r--r-- | lib/arel/relations/operations/join.rb | 4 | ||||
-rw-r--r-- | lib/arel/relations/operations/project.rb | 4 | ||||
-rw-r--r-- | lib/arel/relations/operations/skip.rb | 4 | ||||
-rw-r--r-- | lib/arel/relations/operations/take.rb | 4 |
5 files changed, 13 insertions, 5 deletions
diff --git a/lib/arel/relations/operations/group.rb b/lib/arel/relations/operations/group.rb index 22af2734a6..253c4215b6 100644 --- a/lib/arel/relations/operations/group.rb +++ b/lib/arel/relations/operations/group.rb @@ -8,7 +8,7 @@ module Arel @groupings = (groupings + (block_given?? [yield(self)] : [])).collect { |g| g.bind(relation) } end - def aggregation? + def externalizable? true end end diff --git a/lib/arel/relations/operations/join.rb b/lib/arel/relations/operations/join.rb index 243a0289c7..8025db095e 100644 --- a/lib/arel/relations/operations/join.rb +++ b/lib/arel/relations/operations/join.rb @@ -39,8 +39,8 @@ module Arel end # TESTME - def aggregation? - relation1.aggregation? or relation2.aggregation? + def externalizable? + relation1.externalizable? or relation2.externalizable? end def join? diff --git a/lib/arel/relations/operations/project.rb b/lib/arel/relations/operations/project.rb index 2be87fe694..c92a9df5a5 100644 --- a/lib/arel/relations/operations/project.rb +++ b/lib/arel/relations/operations/project.rb @@ -12,8 +12,8 @@ module Arel @attributes ||= projections.collect { |p| p.bind(self) } end - def aggregation? - attributes.any?(&:aggregation?) + def externalizable? + attributes.any?(&:aggregation?) or relation.externalizable? end end end
\ No newline at end of file diff --git a/lib/arel/relations/operations/skip.rb b/lib/arel/relations/operations/skip.rb index ea5df21f53..930e4c94ea 100644 --- a/lib/arel/relations/operations/skip.rb +++ b/lib/arel/relations/operations/skip.rb @@ -2,5 +2,9 @@ module Arel class Skip < Compound attributes :relation, :skipped deriving :initialize, :== + + def externalizable? + true + end end end
\ No newline at end of file diff --git a/lib/arel/relations/operations/take.rb b/lib/arel/relations/operations/take.rb index 095e430417..2fd3fdf635 100644 --- a/lib/arel/relations/operations/take.rb +++ b/lib/arel/relations/operations/take.rb @@ -2,5 +2,9 @@ module Arel class Take < Compound attributes :relation, :taken deriving :initialize, :== + + def externalizable? + true + end end end
\ No newline at end of file |