Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unfactoring DefaultOperations

  • Loading branch information...
commit 0bb00a6999c7df2ea1c641e8bd6ada3023981617 1 parent 1b4e771
Aaron Patterson tenderlove authored
Showing with 13 additions and 16 deletions.
  1. +13 −16 lib/arel/algebra/relations/relation.rb
29 lib/arel/algebra/relations/relation.rb
View
@@ -194,6 +194,19 @@ def position_of(attribute)
@position_of[attribute] = attributes.index(attributes[attribute])
end
+ def attributes; Header.new end
+ def projections; [] end
+ def wheres; [] end
+ def orders; [] end
+ def inserts; [] end
+ def groupings; [] end
+ def havings; [] end
+ def joins(formatter = nil); nil end # FIXME
+ def taken; nil end
+ def skipped; nil end
+ def sources; [] end
+ def locked; [] end
+
private
def matching_attributes(attribute)
(@matching_attributes ||= attributes.inject({}) do |hash, a|
@@ -205,21 +218,5 @@ def matching_attributes(attribute)
def has_attribute?(attribute)
!matching_attributes(attribute).empty?
end
-
- module DefaultOperations
- def attributes; Header.new end
- def projections; [] end
- def wheres; [] end
- def orders; [] end
- def inserts; [] end
- def groupings; [] end
- def havings; [] end
- def joins(formatter = nil); nil end # FIXME
- def taken; nil end
- def skipped; nil end
- def sources; [] end
- def locked; [] end
- end
- include DefaultOperations
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.