mongoid_query_string_interface 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/mongoid/parsers/array_parser.rb +11 -3
- data/lib/mongoid/parsers/filter_parser.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -10,13 +10,21 @@ module Mongoid
|
|
10
10
|
|
11
11
|
def parse(value)
|
12
12
|
value.split(ARRAY_SEPARATOR).map(&:strip).map do |item|
|
13
|
-
|
13
|
+
parse_item(item)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
|
-
def
|
19
|
-
|
18
|
+
def parse_item(item)
|
19
|
+
other_parsers.each do |parser|
|
20
|
+
return parser.parse(item) if parser.parseable?(item, '')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def other_parsers
|
25
|
+
@other_parsers ||= Mongoid::QueryStringInterface::Parsers::FilterParser::PARSERS.reject do |parser|
|
26
|
+
parser.is_a?(ArrayParser)
|
27
|
+
end
|
20
28
|
end
|
21
29
|
|
22
30
|
def conditional_operators
|
@@ -15,9 +15,9 @@ module Mongoid
|
|
15
15
|
attr_reader :raw_attribute, :raw_value
|
16
16
|
|
17
17
|
PARSERS = [
|
18
|
+
Mongoid::QueryStringInterface::Parsers::ArrayParser.new,
|
18
19
|
Mongoid::QueryStringInterface::Parsers::DateTimeParser.new,
|
19
20
|
Mongoid::QueryStringInterface::Parsers::NumberParser.new,
|
20
|
-
Mongoid::QueryStringInterface::Parsers::ArrayParser.new,
|
21
21
|
Mongoid::QueryStringInterface::Parsers::RegexParser.new,
|
22
22
|
Mongoid::QueryStringInterface::Parsers::BooleanAndNilParser.new
|
23
23
|
]
|
data/lib/version.rb
CHANGED