mongo_mapper-unstable 2010.08.04 → 2010.08.05

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,11 @@ module MongoMapper
12
12
  end
13
13
  end
14
14
 
15
+ def include?(*args)
16
+ load_target
17
+ target.include?(*args)
18
+ end
19
+
15
20
  def reset
16
21
  super
17
22
  target = []
@@ -307,6 +307,16 @@ class ManyDocumentsProxyTest < Test::Unit::TestCase
307
307
  @project2.save
308
308
  end
309
309
 
310
+ context "include?" do
311
+ should "return true if in association" do
312
+ @project1.statuses.should include(@brand_new)
313
+ end
314
+
315
+ should "return false if not in association" do
316
+ @project1.statuses.should_not include(@in_progress)
317
+ end
318
+ end
319
+
310
320
  context "dynamic finders" do
311
321
  should "work with single key" do
312
322
  @project1.statuses.find_by_name('New').should == @brand_new
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2010
7
7
  - 8
8
- - 4
9
- version: 2010.08.04
8
+ - 5
9
+ version: 2010.08.05
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Nunemaker
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-04 00:00:00 -05:00
17
+ date: 2010-08-05 00:00:00 -05:00
18
18
  default_executable: mmconsole
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency