mongo_doc 0.6.10 → 0.6.11

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/README.textile CHANGED
@@ -1,6 +1,6 @@
1
1
  h1. MongoDoc
2
2
 
3
- Version: Hurricane (0.6.10) 2010/07/16
3
+ Version: Hurricane (0.6.11) 2010/07/17
4
4
 
5
5
  h2. Notes
6
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.10
1
+ 0.6.11
@@ -101,14 +101,17 @@ module MongoDoc
101
101
  end
102
102
  end
103
103
 
104
+ def to_key
105
+ persisted? ? [_id] : nil
106
+ end
107
+
104
108
  def to_model
105
109
  self
106
110
  end
107
111
 
108
112
  def to_param
109
- _id ? _id.to_s : nil
113
+ persisted? ? _id.to_s : nil
110
114
  end
111
- alias to_key to_param
112
115
 
113
116
  def update_attributes(attrs)
114
117
  self.attributes = attrs
@@ -25,7 +25,8 @@ module MongoDoc
25
25
  # or conditions
26
26
  #
27
27
  # <tt>Person.find_one('1')</tt>
28
- # <tt>Person.find_one(:where => {:age.gt > 25})</tt>
28
+ # <tt>Person.find_one(:conditions => {:age.gt => 25}, :order_by => [[:name,
29
+ # :asc]])</tt>
29
30
  def find_one(conditions_or_id)
30
31
  if Hash === conditions_or_id
31
32
  Mongoid::Criteria.translate(self, conditions_or_id).one
data/lib/mongo_doc.rb CHANGED
@@ -3,7 +3,7 @@ require 'active_support'
3
3
  require 'active_support/core_ext'
4
4
 
5
5
  module MongoDoc
6
- VERSION = '0.6.10'
6
+ VERSION = '0.6.11'
7
7
  end
8
8
 
9
9
  require 'mongo_doc/connection'
data/mongo_doc.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongo_doc}
8
- s.version = "0.6.10"
8
+ s.version = "0.6.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Les Hill"]
12
- s.date = %q{2010-07-16}
12
+ s.date = %q{2010-07-17}
13
13
  s.description = %q{ODM for MongoDB}
14
14
  s.email = %q{leshill@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -63,7 +63,4 @@ describe MongoDoc::Criteria do
63
63
  original.should_not == chained
64
64
  end
65
65
  end
66
-
67
-
68
-
69
66
  end
@@ -43,7 +43,7 @@ describe "MongoDoc::Document" do
43
43
  it { should be_persisted }
44
44
  its(:id) { should == doc._id }
45
45
  its(:to_param) { should == doc._id.to_s }
46
- its(:to_key) { should == doc._id.to_s }
46
+ its(:to_key) { should == [doc._id] }
47
47
  end
48
48
 
49
49
  context "record has not been persisted" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_doc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 10
10
- version: 0.6.10
9
+ - 11
10
+ version: 0.6.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Les Hill
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-16 00:00:00 -04:00
18
+ date: 2010-07-17 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency