Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

Commit 524637c

Browse files
committed
When normalizing query input, pass-through the values that are not understood
1 parent eada604 commit 524637c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

lib/dm-core/query.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,7 @@ def normalize_options(options = OPTIONS)
970970
def normalize_order
971971
return if @order.nil?
972972

973-
@order = Array(@order)
974-
@order = @order.map do |order|
973+
@order = Array(@order).map do |order|
975974
case order
976975
when Direction
977976
order.dup
@@ -991,6 +990,8 @@ def normalize_order
991990
when Path
992991
Direction.new(order.property)
993992

993+
else
994+
order
994995
end
995996
end
996997
end
@@ -1003,8 +1004,7 @@ def normalize_fields
10031004
case field
10041005
when Symbol, String
10051006
@properties[field]
1006-
1007-
when Property, Operator
1007+
else
10081008
field
10091009
end
10101010
end
@@ -1024,8 +1024,10 @@ def normalize_links
10241024

10251025
while link = stack.pop
10261026
relationship = case link
1027-
when Symbol, String then @relationships[link]
1028-
when Associations::Relationship then link
1027+
when Symbol, String
1028+
@relationships[link]
1029+
else
1030+
link
10291031
end
10301032

10311033
if relationship.respond_to?(:links)

0 commit comments

Comments
 (0)