mongoid 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/HISTORY +39 -0
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/lib/mongoid.rb +3 -1
  5. data/lib/mongoid/associations.rb +5 -5
  6. data/lib/mongoid/associations/has_many.rb +8 -2
  7. data/lib/mongoid/associations/has_many_related.rb +10 -4
  8. data/lib/mongoid/attributes.rb +19 -13
  9. data/lib/mongoid/commands.rb +12 -6
  10. data/lib/mongoid/commands/create.rb +2 -2
  11. data/lib/mongoid/commands/delete_all.rb +1 -1
  12. data/lib/mongoid/commands/save.rb +2 -2
  13. data/lib/mongoid/components.rb +1 -0
  14. data/lib/mongoid/contexts.rb +4 -0
  15. data/lib/mongoid/contexts/enumerable.rb +105 -0
  16. data/lib/mongoid/contexts/mongo.rb +228 -0
  17. data/lib/mongoid/contexts/paging.rb +42 -0
  18. data/lib/mongoid/criteria.rb +42 -191
  19. data/lib/mongoid/document.rb +19 -13
  20. data/lib/mongoid/extensions.rb +1 -0
  21. data/lib/mongoid/extensions/array/accessors.rb +3 -1
  22. data/lib/mongoid/extensions/float/conversions.rb +1 -1
  23. data/lib/mongoid/extensions/hash/accessors.rb +1 -1
  24. data/lib/mongoid/extensions/integer/conversions.rb +1 -0
  25. data/lib/mongoid/fields.rb +6 -5
  26. data/lib/mongoid/matchers.rb +36 -0
  27. data/lib/mongoid/matchers/all.rb +11 -0
  28. data/lib/mongoid/matchers/default.rb +20 -0
  29. data/lib/mongoid/matchers/exists.rb +13 -0
  30. data/lib/mongoid/matchers/gt.rb +11 -0
  31. data/lib/mongoid/matchers/gte.rb +11 -0
  32. data/lib/mongoid/matchers/in.rb +11 -0
  33. data/lib/mongoid/matchers/lt.rb +11 -0
  34. data/lib/mongoid/matchers/lte.rb +11 -0
  35. data/lib/mongoid/matchers/ne.rb +11 -0
  36. data/lib/mongoid/matchers/nin.rb +11 -0
  37. data/lib/mongoid/matchers/size.rb +11 -0
  38. data/lib/mongoid/scope.rb +17 -1
  39. data/mongoid.gemspec +51 -5
  40. data/spec/integration/mongoid/associations_spec.rb +67 -5
  41. data/spec/integration/mongoid/attributes_spec.rb +22 -0
  42. data/spec/integration/mongoid/commands_spec.rb +51 -12
  43. data/spec/integration/mongoid/criteria_spec.rb +3 -3
  44. data/spec/integration/mongoid/document_spec.rb +8 -8
  45. data/spec/integration/mongoid/finders_spec.rb +1 -1
  46. data/spec/integration/mongoid/inheritance_spec.rb +6 -0
  47. data/spec/integration/mongoid/named_scope_spec.rb +1 -1
  48. data/spec/spec_helper.rb +47 -6
  49. data/spec/unit/mongoid/associations/has_many_related_spec.rb +42 -0
  50. data/spec/unit/mongoid/associations/has_many_spec.rb +40 -1
  51. data/spec/unit/mongoid/attributes_spec.rb +1 -1
  52. data/spec/unit/mongoid/commands/create_spec.rb +3 -3
  53. data/spec/unit/mongoid/commands/delete_all_spec.rb +2 -2
  54. data/spec/unit/mongoid/commands/save_spec.rb +2 -2
  55. data/spec/unit/mongoid/commands_spec.rb +12 -12
  56. data/spec/unit/mongoid/contexts/enumerable_spec.rb +208 -0
  57. data/spec/unit/mongoid/contexts/mongo_spec.rb +370 -0
  58. data/spec/unit/mongoid/criteria_spec.rb +182 -21
  59. data/spec/unit/mongoid/extensions/array/accessors_spec.rb +9 -9
  60. data/spec/unit/mongoid/extensions/date/conversions_spec.rb +2 -1
  61. data/spec/unit/mongoid/extensions/float/conversions_spec.rb +4 -4
  62. data/spec/unit/mongoid/extensions/integer/conversions_spec.rb +1 -1
  63. data/spec/unit/mongoid/fields_spec.rb +3 -3
  64. data/spec/unit/mongoid/identity_spec.rb +2 -2
  65. data/spec/unit/mongoid/matchers/all_spec.rb +27 -0
  66. data/spec/unit/mongoid/matchers/default_spec.rb +27 -0
  67. data/spec/unit/mongoid/matchers/exists_spec.rb +56 -0
  68. data/spec/unit/mongoid/matchers/gt_spec.rb +39 -0
  69. data/spec/unit/mongoid/matchers/gte_spec.rb +49 -0
  70. data/spec/unit/mongoid/matchers/in_spec.rb +27 -0
  71. data/spec/unit/mongoid/matchers/lt_spec.rb +39 -0
  72. data/spec/unit/mongoid/matchers/lte_spec.rb +49 -0
  73. data/spec/unit/mongoid/matchers/ne_spec.rb +27 -0
  74. data/spec/unit/mongoid/matchers/nin_spec.rb +27 -0
  75. data/spec/unit/mongoid/matchers/size_spec.rb +27 -0
  76. data/spec/unit/mongoid/matchers_spec.rb +329 -0
  77. data/spec/unit/mongoid/scope_spec.rb +70 -0
  78. data/spec/unit/mongoid/timestamps_spec.rb +2 -2
  79. metadata +50 -4
@@ -19,7 +19,7 @@ module Mongoid #:nodoc:
19
19
  self.collection_name = self.name.collectionize
20
20
 
21
21
  attr_accessor :association_name, :_parent
22
- attr_reader :attributes, :new_record
22
+ attr_reader :new_record
23
23
 
24
24
  delegate :collection, :embedded, :primary_key, :to => "self.class"
25
25
  end
@@ -59,13 +59,12 @@ module Mongoid #:nodoc:
59
59
  #
60
60
  # <tt>Person.instantiate(:title => "Sir", :age => 30)</tt>
61
61
  def instantiate(attrs = {}, allocating = false)
62
- attributes = attrs.with_indifferent_access
63
- if attributes[:_id] || allocating
62
+ if attrs["_id"] || allocating
64
63
  document = allocate
65
- document.instance_variable_set(:@attributes, attributes)
64
+ document.instance_variable_set(:@attributes, attrs)
66
65
  return document
67
66
  else
68
- return new(attributes)
67
+ return new(attrs)
69
68
  end
70
69
  end
71
70
 
@@ -109,7 +108,7 @@ module Mongoid #:nodoc:
109
108
  # all attributes excluding timestamps on the object.
110
109
  def ==(other)
111
110
  return false unless other.is_a?(Document)
112
- @attributes.except(:modified_at).except(:created_at) ==
111
+ attributes.except(:modified_at).except(:created_at) ==
113
112
  other.attributes.except(:modified_at).except(:created_at)
114
113
  end
115
114
 
@@ -131,10 +130,15 @@ module Mongoid #:nodoc:
131
130
  parentize(parent, options.name); notify; self
132
131
  end
133
132
 
133
+ # Return the attributes hash with indifferent access.
134
+ def attributes
135
+ @attributes.with_indifferent_access
136
+ end
137
+
134
138
  # Clone the current +Document+. This will return all attributes with the
135
139
  # exception of the document's id and versions.
136
140
  def clone
137
- self.class.instantiate(@attributes.except(:_id).except(:versions).dup, true)
141
+ self.class.instantiate(@attributes.except("_id").except("versions").dup, true)
138
142
  end
139
143
 
140
144
  # Generate an id for this +Document+.
@@ -157,8 +161,9 @@ module Mongoid #:nodoc:
157
161
  #
158
162
  # <tt>Person.new(:title => "Mr", :age => 30)</tt>
159
163
  def initialize(attrs = {})
160
- @attributes = {}.with_indifferent_access
161
- process(defaults.merge(attrs))
164
+ @attributes = {}
165
+ process(attrs)
166
+ @attributes = defaults.merge(@attributes)
162
167
  @new_record = true if id.nil?
163
168
  document = yield self if block_given?
164
169
  identify
@@ -206,13 +211,13 @@ module Mongoid #:nodoc:
206
211
  # <tt>address.parentize(person, :addresses)</tt>
207
212
  def parentize(object, association_name)
208
213
  self._parent = object
209
- self.association_name = association_name
214
+ self.association_name = association_name.to_s
210
215
  add_observer(object)
211
216
  end
212
217
 
213
218
  # Reloads the +Document+ attributes from the database.
214
219
  def reload
215
- @attributes = collection.find_one(:_id => id).with_indifferent_access
220
+ @attributes = collection.find_one(:_id => id)
216
221
  end
217
222
 
218
223
  # Remove a child document from this parent +Document+. Will reset the
@@ -244,7 +249,7 @@ module Mongoid #:nodoc:
244
249
  #
245
250
  # <tt>person.to_json</tt>
246
251
  def to_json
247
- @attributes.to_json
252
+ attributes.to_json
248
253
  end
249
254
 
250
255
  # Returns the id of the Document, used in Rails compatibility.
@@ -269,7 +274,8 @@ module Mongoid #:nodoc:
269
274
  # there is any.
270
275
  def update(child, clear = false)
271
276
  name = child.association_name
272
- clear ? @attributes.delete(name) : @attributes.insert(name, child.attributes)
277
+ attrs = child.instance_variable_get(:@attributes)
278
+ clear ? @attributes.delete(name) : @attributes.insert(name, attrs)
273
279
  notify
274
280
  end
275
281
  end
@@ -74,6 +74,7 @@ class String #:nodoc
74
74
  end
75
75
 
76
76
  class Symbol #:nodoc
77
+ remove_method :size if instance_methods.include? :size # temporal fix for ruby 1.9
77
78
  include Mongoid::Extensions::Symbol::Inflections
78
79
  end
79
80
 
@@ -6,9 +6,11 @@ module Mongoid #:nodoc:
6
6
  # If the attributes already exists in the array then they will be
7
7
  # updated, otherwise they will be appended.
8
8
  def update(attributes)
9
- delete_if { |e| attributes[:_id] && (e[:_id] == attributes[:_id]) }
9
+ delete_if { |e| attributes["_id"] && (e["_id"] == attributes["_id"]) }
10
10
  self.<< attributes
11
11
  end
12
+
13
+ alias :merge! :update
12
14
  end
13
15
  end
14
16
  end
@@ -4,7 +4,7 @@ module Mongoid #:nodoc:
4
4
  module Float #:nodoc:
5
5
  module Conversions #:nodoc:
6
6
  def set(value)
7
- return 0.0 if value.blank?
7
+ return nil if value.blank?
8
8
  value =~ /\d/ ? value.to_f : value
9
9
  end
10
10
  def get(value)
@@ -21,7 +21,7 @@ module Mongoid #:nodoc:
21
21
  def insert(key, attrs)
22
22
  elements = self[key]
23
23
  if elements
24
- elements.update(attrs)
24
+ elements.merge!(attrs)
25
25
  else
26
26
  self[key] = key.singular? ? attrs : [attrs]
27
27
  end
@@ -4,6 +4,7 @@ module Mongoid #:nodoc:
4
4
  module Integer #:nodoc:
5
5
  module Conversions #:nodoc:
6
6
  def set(value)
7
+ return nil if value.blank?
7
8
  value =~ /\d/ ? value.to_i : value
8
9
  end
9
10
  def get(value)
@@ -8,8 +8,8 @@ module Mongoid #:nodoc
8
8
  # These include defaults, fields
9
9
  class_inheritable_accessor :defaults, :fields
10
10
 
11
- self.defaults = {}.with_indifferent_access
12
- self.fields = {}.with_indifferent_access
11
+ self.defaults = {}
12
+ self.fields = {}
13
13
 
14
14
  delegate :defaults, :fields, :to => "self.class"
15
15
  end
@@ -29,15 +29,16 @@ module Mongoid #:nodoc
29
29
  #
30
30
  # <tt>field :score, :default => 0</tt>
31
31
  def field(name, options = {})
32
- set_field(name, options)
33
- set_default(name, options)
32
+ access = name.to_s
33
+ set_field(access, options)
34
+ set_default(access, options)
34
35
  end
35
36
 
36
37
  protected
37
38
  # Define a field attribute for the +Document+.
38
39
  def set_field(name, options = {})
39
40
  meth = options.delete(:as) || name
40
- fields[name] = Field.new(name.to_s, options)
41
+ fields[name] = Field.new(name, options)
41
42
  create_accessors(name, meth, options)
42
43
  end
43
44
 
@@ -0,0 +1,36 @@
1
+ # encoding: utf-8
2
+ require "mongoid/matchers/default"
3
+ require "mongoid/matchers/all"
4
+ require "mongoid/matchers/exists"
5
+ require "mongoid/matchers/gt"
6
+ require "mongoid/matchers/gte"
7
+ require "mongoid/matchers/in"
8
+ require "mongoid/matchers/lt"
9
+ require "mongoid/matchers/lte"
10
+ require "mongoid/matchers/ne"
11
+ require "mongoid/matchers/nin"
12
+ require "mongoid/matchers/size"
13
+
14
+ module Mongoid #:nodoc:
15
+ module Matchers
16
+ # Determines if this document has the attributes to match the supplied
17
+ # MongoDB selector. Used for matching on embedded associations.
18
+ def matches?(selector)
19
+ selector.each_pair do |key, value|
20
+ return false unless matcher(key, value).matches?(value)
21
+ end
22
+ true
23
+ end
24
+
25
+ protected
26
+ # Get the matcher for the supplied key and value. Will determine the class
27
+ # name from the key.
28
+ def matcher(key, value)
29
+ if value.is_a?(Hash)
30
+ name = "Mongoid::Matchers::#{value.keys.first.gsub("$", "").camelize}"
31
+ return name.constantize.new(attributes[key])
32
+ end
33
+ Default.new(attributes[key])
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class All < Default
5
+ # Return true if the attribute and first value in the hash are equal.
6
+ def matches?(value)
7
+ @attribute == value.values.first
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Default
5
+ # Creating a new matcher only requires the value.
6
+ def initialize(attribute)
7
+ @attribute = attribute
8
+ end
9
+ # Return true if the attribute and value are equal.
10
+ def matches?(value)
11
+ @attribute == value
12
+ end
13
+
14
+ protected
15
+ def first(value)
16
+ value.values.first
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Exists < Default
5
+ # Return true if the attribute exists and checking for existence or
6
+ # return true if the attribute does not exist and checking for
7
+ # non-existence.
8
+ def matches?(value)
9
+ @attribute.nil? != value.values.first
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Gt < Default
5
+ # Return true if the attribute is greater than the value.
6
+ def matches?(value)
7
+ @attribute ? @attribute > first(value) : false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Gte < Default
5
+ # Return true if the attribute is greater than or equal to the value.
6
+ def matches?(value)
7
+ @attribute ? @attribute >= first(value) : false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class In < Default
5
+ # Return true if the attribute is in the values.
6
+ def matches?(value)
7
+ value.values.first.include?(@attribute)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Lt < Default
5
+ # Return true if the attribute is less than the value.
6
+ def matches?(value)
7
+ @attribute ? @attribute < first(value) : false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Lte < Default
5
+ # Return true if the attribute is less than or equal to the value.
6
+ def matches?(value)
7
+ @attribute ? @attribute <= first(value) : false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Ne < Default
5
+ # Return true if the attribute and first value are not equal.
6
+ def matches?(value)
7
+ @attribute != value.values.first
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Nin < Default
5
+ # Return true if the attribute is not in the value list.
6
+ def matches?(value)
7
+ !value.values.first.include?(@attribute)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Mongoid #:nodoc:
3
+ module Matchers #:nodoc:
4
+ class Size < Default
5
+ # Return true if the attribute size is equal to the first value.
6
+ def matches?(value)
7
+ @attribute.size == value.values.first
8
+ end
9
+ end
10
+ end
11
+ end
@@ -2,7 +2,23 @@
2
2
  module Mongoid #:nodoc:
3
3
  class Scope #:nodoc:
4
4
 
5
- delegate :scopes, :to => "@parent"
5
+ delegate :scopes, :to => :parent
6
+
7
+ attr_reader :parent, :conditions
8
+
9
+ # If the other is a scope then compare the parent and conditions, otherwise
10
+ # if its enumerable collect and compare.
11
+ def ==(other)
12
+ case other
13
+ when Scope
14
+ @parent == other.parent && @conditions == other.conditions
15
+ when Enumerable
16
+ @collection ||= entries
17
+ return (@collection == other)
18
+ else
19
+ return false
20
+ end
21
+ end
6
22
 
7
23
  # Create the new +Scope+. If a block is passed in, this Scope will extend
8
24
  # the block.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoid}
8
- s.version = "1.0.6"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Durran Jordan"]
12
- s.date = %q{2010-01-14}
12
+ s.date = %q{2010-01-21}
13
13
  s.email = %q{durran@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.rdoc"
@@ -45,6 +45,10 @@ Gem::Specification.new do |s|
45
45
  "lib/mongoid/complex_criterion.rb",
46
46
  "lib/mongoid/components.rb",
47
47
  "lib/mongoid/config.rb",
48
+ "lib/mongoid/contexts.rb",
49
+ "lib/mongoid/contexts/enumerable.rb",
50
+ "lib/mongoid/contexts/mongo.rb",
51
+ "lib/mongoid/contexts/paging.rb",
48
52
  "lib/mongoid/criteria.rb",
49
53
  "lib/mongoid/document.rb",
50
54
  "lib/mongoid/errors.rb",
@@ -75,6 +79,18 @@ Gem::Specification.new do |s|
75
79
  "lib/mongoid/finders.rb",
76
80
  "lib/mongoid/identity.rb",
77
81
  "lib/mongoid/indexes.rb",
82
+ "lib/mongoid/matchers.rb",
83
+ "lib/mongoid/matchers/all.rb",
84
+ "lib/mongoid/matchers/default.rb",
85
+ "lib/mongoid/matchers/exists.rb",
86
+ "lib/mongoid/matchers/gt.rb",
87
+ "lib/mongoid/matchers/gte.rb",
88
+ "lib/mongoid/matchers/in.rb",
89
+ "lib/mongoid/matchers/lt.rb",
90
+ "lib/mongoid/matchers/lte.rb",
91
+ "lib/mongoid/matchers/ne.rb",
92
+ "lib/mongoid/matchers/nin.rb",
93
+ "lib/mongoid/matchers/size.rb",
78
94
  "lib/mongoid/memoization.rb",
79
95
  "lib/mongoid/named_scope.rb",
80
96
  "lib/mongoid/scope.rb",
@@ -83,6 +99,7 @@ Gem::Specification.new do |s|
83
99
  "mongoid.gemspec",
84
100
  "perf/benchmark.rb",
85
101
  "spec/integration/mongoid/associations_spec.rb",
102
+ "spec/integration/mongoid/attributes_spec.rb",
86
103
  "spec/integration/mongoid/commands_spec.rb",
87
104
  "spec/integration/mongoid/criteria_spec.rb",
88
105
  "spec/integration/mongoid/document_spec.rb",
@@ -110,6 +127,8 @@ Gem::Specification.new do |s|
110
127
  "spec/unit/mongoid/commands/save_spec.rb",
111
128
  "spec/unit/mongoid/commands_spec.rb",
112
129
  "spec/unit/mongoid/config_spec.rb",
130
+ "spec/unit/mongoid/contexts/enumerable_spec.rb",
131
+ "spec/unit/mongoid/contexts/mongo_spec.rb",
113
132
  "spec/unit/mongoid/criteria_spec.rb",
114
133
  "spec/unit/mongoid/document_spec.rb",
115
134
  "spec/unit/mongoid/errors_spec.rb",
@@ -139,6 +158,18 @@ Gem::Specification.new do |s|
139
158
  "spec/unit/mongoid/finders_spec.rb",
140
159
  "spec/unit/mongoid/identity_spec.rb",
141
160
  "spec/unit/mongoid/indexes_spec.rb",
161
+ "spec/unit/mongoid/matchers/all_spec.rb",
162
+ "spec/unit/mongoid/matchers/default_spec.rb",
163
+ "spec/unit/mongoid/matchers/exists_spec.rb",
164
+ "spec/unit/mongoid/matchers/gt_spec.rb",
165
+ "spec/unit/mongoid/matchers/gte_spec.rb",
166
+ "spec/unit/mongoid/matchers/in_spec.rb",
167
+ "spec/unit/mongoid/matchers/lt_spec.rb",
168
+ "spec/unit/mongoid/matchers/lte_spec.rb",
169
+ "spec/unit/mongoid/matchers/ne_spec.rb",
170
+ "spec/unit/mongoid/matchers/nin_spec.rb",
171
+ "spec/unit/mongoid/matchers/size_spec.rb",
172
+ "spec/unit/mongoid/matchers_spec.rb",
142
173
  "spec/unit/mongoid/memoization_spec.rb",
143
174
  "spec/unit/mongoid/named_scope_spec.rb",
144
175
  "spec/unit/mongoid/scope_spec.rb",
@@ -153,6 +184,7 @@ Gem::Specification.new do |s|
153
184
  s.summary = %q{ODM framework for MongoDB}
154
185
  s.test_files = [
155
186
  "spec/integration/mongoid/associations_spec.rb",
187
+ "spec/integration/mongoid/attributes_spec.rb",
156
188
  "spec/integration/mongoid/commands_spec.rb",
157
189
  "spec/integration/mongoid/criteria_spec.rb",
158
190
  "spec/integration/mongoid/document_spec.rb",
@@ -179,6 +211,8 @@ Gem::Specification.new do |s|
179
211
  "spec/unit/mongoid/commands/save_spec.rb",
180
212
  "spec/unit/mongoid/commands_spec.rb",
181
213
  "spec/unit/mongoid/config_spec.rb",
214
+ "spec/unit/mongoid/contexts/enumerable_spec.rb",
215
+ "spec/unit/mongoid/contexts/mongo_spec.rb",
182
216
  "spec/unit/mongoid/criteria_spec.rb",
183
217
  "spec/unit/mongoid/document_spec.rb",
184
218
  "spec/unit/mongoid/errors_spec.rb",
@@ -208,6 +242,18 @@ Gem::Specification.new do |s|
208
242
  "spec/unit/mongoid/finders_spec.rb",
209
243
  "spec/unit/mongoid/identity_spec.rb",
210
244
  "spec/unit/mongoid/indexes_spec.rb",
245
+ "spec/unit/mongoid/matchers/all_spec.rb",
246
+ "spec/unit/mongoid/matchers/default_spec.rb",
247
+ "spec/unit/mongoid/matchers/exists_spec.rb",
248
+ "spec/unit/mongoid/matchers/gt_spec.rb",
249
+ "spec/unit/mongoid/matchers/gte_spec.rb",
250
+ "spec/unit/mongoid/matchers/in_spec.rb",
251
+ "spec/unit/mongoid/matchers/lt_spec.rb",
252
+ "spec/unit/mongoid/matchers/lte_spec.rb",
253
+ "spec/unit/mongoid/matchers/ne_spec.rb",
254
+ "spec/unit/mongoid/matchers/nin_spec.rb",
255
+ "spec/unit/mongoid/matchers/size_spec.rb",
256
+ "spec/unit/mongoid/matchers_spec.rb",
211
257
  "spec/unit/mongoid/memoization_spec.rb",
212
258
  "spec/unit/mongoid/named_scope_spec.rb",
213
259
  "spec/unit/mongoid/scope_spec.rb",
@@ -221,14 +267,14 @@ Gem::Specification.new do |s|
221
267
  s.specification_version = 3
222
268
 
223
269
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
224
- s.add_runtime_dependency(%q<activesupport>, [">= 2.2.2"])
270
+ s.add_runtime_dependency(%q<activesupport>, ["<= 2.3.5"])
225
271
  s.add_runtime_dependency(%q<mongo>, [">= 0.18.2"])
226
272
  s.add_runtime_dependency(%q<durran-validatable>, [">= 2.0.1"])
227
273
  s.add_runtime_dependency(%q<leshill-will_paginate>, [">= 2.3.11"])
228
274
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
229
275
  s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
230
276
  else
231
- s.add_dependency(%q<activesupport>, [">= 2.2.2"])
277
+ s.add_dependency(%q<activesupport>, ["<= 2.3.5"])
232
278
  s.add_dependency(%q<mongo>, [">= 0.18.2"])
233
279
  s.add_dependency(%q<durran-validatable>, [">= 2.0.1"])
234
280
  s.add_dependency(%q<leshill-will_paginate>, [">= 2.3.11"])
@@ -236,7 +282,7 @@ Gem::Specification.new do |s|
236
282
  s.add_dependency(%q<mocha>, [">= 0.9.8"])
237
283
  end
238
284
  else
239
- s.add_dependency(%q<activesupport>, [">= 2.2.2"])
285
+ s.add_dependency(%q<activesupport>, ["<= 2.3.5"])
240
286
  s.add_dependency(%q<mongo>, [">= 0.18.2"])
241
287
  s.add_dependency(%q<durran-validatable>, [">= 2.0.1"])
242
288
  s.add_dependency(%q<leshill-will_paginate>, [">= 2.3.11"])