mongo_doc 0.6.33 → 0.6.34
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongo_doc/document.rb +1 -12
- data/lib/mongo_doc/scope.rb +5 -1
- data/lib/mongo_doc/version.rb +1 -1
- metadata +29 -29
data/lib/mongo_doc/document.rb
CHANGED
@@ -36,6 +36,7 @@ module MongoDoc
|
|
36
36
|
extend ReferencesMany
|
37
37
|
include ::ActiveModel::Validations
|
38
38
|
extend ::ActiveModel::Naming
|
39
|
+
include ::ActiveModel::Conversion
|
39
40
|
extend Validations
|
40
41
|
|
41
42
|
alias id _id
|
@@ -101,18 +102,6 @@ module MongoDoc
|
|
101
102
|
end
|
102
103
|
end
|
103
104
|
|
104
|
-
def to_key
|
105
|
-
persisted? ? [_id] : nil
|
106
|
-
end
|
107
|
-
|
108
|
-
def to_model
|
109
|
-
self
|
110
|
-
end
|
111
|
-
|
112
|
-
def to_param
|
113
|
-
persisted? ? _id.to_s : nil
|
114
|
-
end
|
115
|
-
|
116
105
|
def update_attributes(attrs)
|
117
106
|
self.attributes = attrs
|
118
107
|
return save if new_record?
|
data/lib/mongo_doc/scope.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# Based on ActiveRecord::NamedScope
|
2
2
|
module MongoDoc
|
3
3
|
module Scope
|
4
|
+
def self.extended(klass)
|
5
|
+
klass.class_attribute :_scopes
|
6
|
+
end
|
7
|
+
|
4
8
|
def scopes
|
5
|
-
|
9
|
+
self._scopes ||= {}
|
6
10
|
end
|
7
11
|
|
8
12
|
def scope(name, *args, &block)
|
data/lib/mongo_doc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_doc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.34
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,88 +9,88 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-21 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
16
|
-
requirement: &
|
16
|
+
requirement: &70306841631680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: 3.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70306841631680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &70306841630960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
32
|
+
version: 3.2.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70306841630960
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bson_ext
|
38
|
-
requirement: &
|
38
|
+
requirement: &70306841629700 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
43
|
+
version: 1.6.1
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70306841629700
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: mongo
|
49
|
-
requirement: &
|
49
|
+
requirement: &70306841629120 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.6.1
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70306841629120
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: tzinfo
|
60
|
-
requirement: &
|
60
|
+
requirement: &70306841628440 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.3.
|
65
|
+
version: 0.3.32
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70306841628440
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: cucumber
|
71
|
-
requirement: &
|
71
|
+
requirement: &70306841627320 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 1.1.9
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70306841627320
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &70306841626840 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: 2.
|
87
|
+
version: 2.9.0
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70306841626840
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: ruby-debug19
|
93
|
-
requirement: &
|
93
|
+
requirement: &70306841626260 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 0.11.6
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70306841626260
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rake
|
104
|
-
requirement: &
|
104
|
+
requirement: &70306841625620 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 0.9.2.2
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70306841625620
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rdoc
|
115
|
-
requirement: &
|
115
|
+
requirement: &70306841625140 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,7 +120,7 @@ dependencies:
|
|
120
120
|
version: 2.4.2
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70306841625140
|
124
124
|
description: ODM for MongoDB
|
125
125
|
email: leshill@gmail.com
|
126
126
|
executables: []
|