mongoid_query_string_interface 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongoid_query_string_interface (0.4.1)
4
+ mongoid_query_string_interface (0.4.2)
5
5
  json (>= 1.4.6)
6
6
  mongoid (~> 2.0.0.rc)
7
7
 
@@ -77,7 +77,9 @@ module Mongoid
77
77
 
78
78
  private
79
79
  def parsed_attribute
80
- if or_attribute?
80
+ if raw_attribute.is_a?(Mongoid::Criterion::Complex)
81
+ raw_attribute.key.to_s
82
+ elsif or_attribute?
81
83
  '$or'
82
84
  elsif raw_attribute =~ Mongoid::QueryStringInterface::ATTRIBUTE_REGEX
83
85
  $1
@@ -141,7 +143,9 @@ module Mongoid
141
143
  end
142
144
 
143
145
  def operator_from(attribute)
144
- if or_attribute?
146
+ if attribute.is_a?(Mongoid::Criterion::Complex)
147
+ "$#{attribute.operator}"
148
+ elsif or_attribute?
145
149
  '$or'
146
150
  elsif attribute =~ Mongoid::QueryStringInterface::OPERATOR_REGEX
147
151
  "$#{$1}"
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Mongoid #:nodoc
3
3
  module QueryStringInterface #:nodoc
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
6
6
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Vicente Mundim
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-06-07 00:00:00 -03:00
17
+ date: 2011-06-17 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency