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

Commit

Permalink
When normalizing query input, pass-through the values that are not un…
Browse files Browse the repository at this point in the history
…derstood
  • Loading branch information
dkubb committed Feb 15, 2012
1 parent eada604 commit 524637c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/dm-core/query.rb
Expand Up @@ -970,8 +970,7 @@ def normalize_options(options = OPTIONS)
def normalize_order
return if @order.nil?

@order = Array(@order)
@order = @order.map do |order|
@order = Array(@order).map do |order|
case order
when Direction
order.dup
Expand All @@ -991,6 +990,8 @@ def normalize_order
when Path
Direction.new(order.property)

else
order
end
end
end
Expand All @@ -1003,8 +1004,7 @@ def normalize_fields
case field
when Symbol, String
@properties[field]

when Property, Operator
else
field
end
end
Expand All @@ -1024,8 +1024,10 @@ def normalize_links

while link = stack.pop
relationship = case link
when Symbol, String then @relationships[link]
when Associations::Relationship then link
when Symbol, String
@relationships[link]
else
link
end

if relationship.respond_to?(:links)
Expand Down

0 comments on commit 524637c

Please sign in to comment.