mongo_doc 0.6.28 → 0.6.29

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -1,6 +1,6 @@
1
1
  h1. MongoDoc
2
2
 
3
- Version: 0.6.27 2011/03/05
3
+ Version: 0.6.29 2011/05/17
4
4
 
5
5
  I use MongoDoc in production on my own apps, and have been using (lightly)
6
6
  MongoMapper and (heavily) Mongoid since 2009. By Summer 2010, I had come to the
@@ -212,7 +212,7 @@ module MongoDoc
212
212
  end
213
213
 
214
214
  def before_save_callback(root)
215
- self._id = ::BSON::ObjectID.new if new_record?
215
+ self._id = ::BSON::ObjectId.new if new_record?
216
216
  end
217
217
 
218
218
  def save_failed_callback(root)
@@ -1,11 +1,11 @@
1
1
  module BSON
2
- class ObjectID
2
+ class ObjectId
3
3
  def to_bson(*args)
4
4
  self
5
5
  end
6
6
 
7
7
  def self.cast_from_string(string)
8
- ObjectID.from_string(string) unless string.blank?
8
+ ObjectId.from_string(string) unless string.blank?
9
9
  end
10
10
  end
11
11
  end
@@ -6,7 +6,7 @@ module MongoDoc
6
6
  base.extend(Criteria) unless base === Criteria
7
7
  end
8
8
 
9
- # Find a +Document+ based on id (+String+ or +BSON::ObjectID+)
9
+ # Find a +Document+ based on id (+String+ or +BSON::ObjectId+)
10
10
  #
11
11
  # <tt>Person.find('1')</tt>
12
12
  # <tt>Person.find(obj_id_1, obj_id_2)</tt>
@@ -21,7 +21,7 @@ module MongoDoc
21
21
  criteria
22
22
  end
23
23
 
24
- # Find a +Document+ based on id (+String+ or +BSON::ObjectID+)
24
+ # Find a +Document+ based on id (+String+ or +BSON::ObjectId+)
25
25
  # or conditions
26
26
  #
27
27
  # <tt>Person.find_one('1')</tt>
@@ -7,9 +7,9 @@ module MongoDoc
7
7
  end
8
8
 
9
9
  # Declare a reference to another +Document+. The reference can either be an
10
- # +ObjectID+ reference, or a +BSON::DBRef+
10
+ # +ObjectId+ reference, or a +BSON::DBRef+
11
11
  #
12
- # Use an +ObjectID+ reference when you have a simple reference or will be
12
+ # Use an +ObjectId+ reference when you have a simple reference or will be
13
13
  # referencing a single polymorphic collection. Example:
14
14
  #
15
15
  # +references :address
@@ -39,7 +39,7 @@ module MongoDoc
39
39
  private
40
40
 
41
41
  def references_by_id(klass, attr_name)
42
- attr_accessor "#{attr_name}_id".to_sym, :type => ::BSON::ObjectID
42
+ attr_accessor "#{attr_name}_id".to_sym, :type => ::BSON::ObjectId
43
43
 
44
44
  module_eval(<<-RUBY, __FILE__, __LINE__)
45
45
  def #{attr_name}_id_with_reference=(value) # def address_id_with_reference=(value)
@@ -15,7 +15,7 @@ module MongoDoc
15
15
  else
16
16
  ids_or_strings.map do |item|
17
17
  if String === item
18
- ::BSON::ObjectID.cast_from_string(item)
18
+ ::BSON::ObjectId.cast_from_string(item)
19
19
  else
20
20
  item
21
21
  end
@@ -48,9 +48,9 @@ module MongoDoc
48
48
  end
49
49
 
50
50
  # Declare reference to an array of +Document+s. The references can be
51
- # +ObjectID+ references or a +BSON::DBRef+, but cannot be both.
51
+ # +ObjectId+ references or a +BSON::DBRef+, but cannot be both.
52
52
  #
53
- # Use an +ObjectID+ reference when you have a simple reference or will be
53
+ # Use an +ObjectId+ reference when you have a simple reference or will be
54
54
  # referencing a single polymorphic collection. Example:
55
55
  #
56
56
  # +references_many :addresses
@@ -1,3 +1,3 @@
1
1
  module MongoDoc
2
- VERSION = "0.6.28"
2
+ VERSION = "0.6.29"
3
3
  end
@@ -3,7 +3,7 @@ module Mongoid
3
3
  module IdConversion
4
4
  protected
5
5
 
6
- # Convert ids from strings to +BSON::ObjectID+s
6
+ # Convert ids from strings to +BSON::ObjectId+s
7
7
  def strings_to_object_ids(ids)
8
8
  if Array === ids
9
9
  ids.map {|id| string_to_object_id(id) }
@@ -13,10 +13,10 @@ module Mongoid
13
13
 
14
14
  end
15
15
 
16
- # Convert ids from strings to +BSON::ObjectID+s
16
+ # Convert ids from strings to +BSON::ObjectId+s
17
17
  def string_to_object_id(id)
18
18
  if String === id
19
- ::BSON::ObjectID.from_string(id)
19
+ ::BSON::ObjectId.from_string(id)
20
20
  else
21
21
  id
22
22
  end
@@ -67,7 +67,7 @@ module Mongoid #:nodoc:
67
67
  #
68
68
  # Options:
69
69
  #
70
- # object_id: A +String+ representation of a <tt>BSON::ObjectID</tt>
70
+ # object_id: A +String+ representation of a <tt>BSON::ObjectId</tt>
71
71
  #
72
72
  # Example:
73
73
  #
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mongo_doc
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.28
5
+ version: 0.6.29
6
6
  platform: ruby
7
7
  authors:
8
8
  - Les Hill
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-09 00:00:00 -04:00
13
+ date: 2011-05-17 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -36,71 +36,60 @@ dependencies:
36
36
  type: :runtime
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
39
- name: bson
39
+ name: bson_ext
40
40
  prerelease: false
41
41
  requirement: &id003 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
- - - "="
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.4
46
+ version: 1.3.1
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: bson_ext
51
- prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - "="
56
- - !ruby/object:Gem::Version
57
- version: 1.0.4
58
- type: :runtime
59
- version_requirements: *id004
60
49
  - !ruby/object:Gem::Dependency
61
50
  name: mongo
62
51
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
52
+ requirement: &id004 !ruby/object:Gem::Requirement
64
53
  none: false
65
54
  requirements:
66
55
  - - ">="
67
56
  - !ruby/object:Gem::Version
68
- version: 1.0.0
57
+ version: 1.3.1
69
58
  type: :runtime
70
- version_requirements: *id005
59
+ version_requirements: *id004
71
60
  - !ruby/object:Gem::Dependency
72
61
  name: tzinfo
73
62
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
63
+ requirement: &id005 !ruby/object:Gem::Requirement
75
64
  none: false
76
65
  requirements:
77
66
  - - ">="
78
67
  - !ruby/object:Gem::Version
79
68
  version: 0.3.22
80
69
  type: :runtime
81
- version_requirements: *id006
70
+ version_requirements: *id005
82
71
  - !ruby/object:Gem::Dependency
83
72
  name: cucumber
84
73
  prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
74
+ requirement: &id006 !ruby/object:Gem::Requirement
86
75
  none: false
87
76
  requirements:
88
77
  - - ">="
89
78
  - !ruby/object:Gem::Version
90
79
  version: 0.10.0
91
80
  type: :development
92
- version_requirements: *id007
81
+ version_requirements: *id006
93
82
  - !ruby/object:Gem::Dependency
94
83
  name: rspec
95
84
  prerelease: false
96
- requirement: &id008 !ruby/object:Gem::Requirement
85
+ requirement: &id007 !ruby/object:Gem::Requirement
97
86
  none: false
98
87
  requirements:
99
88
  - - ">="
100
89
  - !ruby/object:Gem::Version
101
90
  version: 2.5.0
102
91
  type: :development
103
- version_requirements: *id008
92
+ version_requirements: *id007
104
93
  description: ODM for MongoDB
105
94
  email: leshill@gmail.com
106
95
  executables: []