mongo_odm 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2010 Carlos Paramio
1
+ Copyright 2010, 2011 Carlos Paramio
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -384,6 +384,7 @@ All the validation methods defined in ActiveModel::Validations are included
384
384
  Example:
385
385
 
386
386
  class User
387
+ include MongoODM::Document
387
388
  field :email
388
389
 
389
390
  validates_presence_of :email
@@ -398,6 +399,7 @@ All the dirty object methods defined in ActiveModel::Dirty are included
398
399
  Example:
399
400
 
400
401
  class User
402
+ include MongoODM::Document
401
403
  field :email
402
404
  end
403
405
 
@@ -407,14 +409,26 @@ Example:
407
409
  user.email_change # Returns [nil, "hello@h1labs.com"]
408
410
  user.changes # Returns {"email" => [nil, "hello@h1labs.com"]}
409
411
 
412
+ = Others
413
+
414
+ Access to a cursor to the whole collection:
415
+
416
+ User.cursor
417
+
418
+ Use cursor methods directly on the class:
419
+
420
+ User.has_next?
421
+ User.each{...}
422
+ User.next_document
423
+ User.rewind!
424
+ ...
425
+
410
426
  = TODO
411
427
 
412
- * Support join of different concatenated find calls to a single criteria object
413
- * Add helpers to define attributes as referenced objects
414
428
  * Allow to specify different database connections with each document definition
415
429
  * Increase rspec coverage
416
430
  * Document, document, document!
417
- * Create useful modules to make common operations easier (versioning, localization, etc)
431
+ * Create useful modules to make common operations easier (versioning, trees, etc)
418
432
 
419
433
  = More
420
434
 
@@ -422,12 +436,12 @@ For now, take a look at the Mongo Ruby driver syntax:
422
436
 
423
437
  http://api.mongodb.org/ruby/1.0.8/index.html
424
438
 
425
- = Copyright
439
+ = Credits
426
440
 
427
- Copyright © 2010 Carlos Paramio. See LICENSE for details.
441
+ Carlos Paramio, http://h1labs.com.
428
442
 
429
- = Credits
443
+ See CONTRIBUTORS file for a list of contributions.
430
444
 
431
- Carlos Paramio
445
+ = License
432
446
 
433
- http://h1labs.com
447
+ See LICENSE file for details.
@@ -98,6 +98,10 @@ module MongoODM
98
98
  end
99
99
  end
100
100
 
101
+ def cursor
102
+ @cursor ||= find.cursor
103
+ end
104
+
101
105
  def destroy_all(*args)
102
106
  documents = find(*args)
103
107
  count = documents.count
@@ -110,6 +114,14 @@ module MongoODM
110
114
  return value if value.class == self
111
115
  new(value)
112
116
  end
117
+
118
+ def method_missing(method_name, *args, &block)
119
+ if cursor.respond_to?(method_name)
120
+ cursor.send(method_name, *args, &block)
121
+ else
122
+ super
123
+ end
124
+ end
113
125
 
114
126
  end
115
127
 
@@ -2,6 +2,6 @@
2
2
  module MongoODM
3
3
  VERSION_MAJOR = "0"
4
4
  VERSION_MINOR = "2"
5
- VERSION_BUILD = "7"
5
+ VERSION_BUILD = "8"
6
6
  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_BUILD}"
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mongo_odm
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.7
5
+ version: 0.2.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Carlos Paramio