Permalink
Browse files

When normalizing query input, pass-through the values that are not un…

…derstood
  • Loading branch information...
1 parent eada604 commit 524637c3348ebbcac0f677b6395b7b7fc0dea96b @dkubb dkubb committed Feb 15, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/dm-core/query.rb
View
14 lib/dm-core/query.rb
@@ -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
@@ -991,6 +990,8 @@ def normalize_order
when Path
Direction.new(order.property)
+ else
+ order
end
end
end
@@ -1003,8 +1004,7 @@ def normalize_fields
case field
when Symbol, String
@properties[field]
-
- when Property, Operator
+ else
field
end
end
@@ -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)

0 comments on commit 524637c

Please sign in to comment.