Permalink
Browse files

Change #normalize_key to #symbolize_key in query

  • Loading branch information...
1 parent da19e2f commit b34ffdff0b6af983d2c62e98d95825a0105d8beb @jnunemaker jnunemaker committed Oct 11, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/plucky/query.rb
View
@@ -193,13 +193,13 @@ def amend(opts={})
end
def [](key)
- key = normalized_key(key)
+ key = symbolized_key(key)
source = hash_for_key(key)
source[key]
end
def []=(key, value)
- key = normalized_key(key)
+ key = symbolized_key(key)
source = hash_for_key(key)
source[key] = value
end
@@ -243,7 +243,7 @@ def hash_for_key(key)
options_key?(key) ? @options : @criteria
end
- def normalized_key(key)
+ def symbolized_key(key)
if key.respond_to?(:to_sym)
key.to_sym
else
@@ -257,7 +257,7 @@ def options_key?(key)
def set_field_inclusion(fields, value)
fields_option = {}
- fields.each { |field| fields_option[normalized_key(field)] = value }
+ fields.each { |field| fields_option[symbolized_key(field)] = value }
clone.tap { |query| query.options[:fields] = fields_option }
end
end

0 comments on commit b34ffdf

Please sign in to comment.