Skip to content
Browse files

Ensuring that we don't modify the params hash

  • Loading branch information...
1 parent 45e3bca commit 4edc0da425489fa93aa1681c0f1e3839dbf77e04 @vicentemundim committed Jun 20, 2012
Showing with 7 additions and 4 deletions.
  1. +1 −1 Gemfile.lock
  2. +5 −2 lib/mongoid/query_string_interface.rb
  3. +1 −1 lib/version.rb
View
2 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- mongoid_query_string_interface (0.7.0)
+ mongoid_query_string_interface (0.7.1)
mongoid (>= 2.0.2)
query_string_interface (>= 0.5.0)
will_paginate (~> 3.0.pre2)
View
7 lib/mongoid/query_string_interface.rb
@@ -55,9 +55,12 @@ def filter_fields_by(params)
end
def field_filtering_options(params)
- super.tap do |hash|
- hash[:without] = hash.delete(:except) if hash.present?
+ hash = super
+ if hash.present?
+ hash = hash.dup
+ hash[:without] = hash.delete(:except)
end
+ hash
end
protected
View
2 lib/version.rb
@@ -1,6 +1,6 @@
# encoding: utf-8
module Mongoid #:nodoc
module QueryStringInterface #:nodoc
- VERSION = "0.7.0"
+ VERSION = "0.7.1"
end
end

0 comments on commit 4edc0da

Please sign in to comment.
Something went wrong with that request. Please try again.