mongoid-crud 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/mongoid-crud/ext.rb +8 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beec8ad681d3e1ae3ddf31c1c0652b73d1592a8c
|
4
|
+
data.tar.gz: ee017fad081f1432ea1bedc57a613d3f6b86e7b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f7bd7c0fbcf7a4db25398f8d65059755de00cd043dcc9b58df6bcd06159b09bef81df1a0784c87b54e6a00726eb49871b19cd1f1b24cab2c1ca184faff1d16f
|
7
|
+
data.tar.gz: 724746f00c39839d5944c7e9ab1c50446c8b1a6345468f8f4111c212f1f8ced40393648d5b2fa55b11be0ca61e304bb6910c9906e26e97990d75583d06a7d9d6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.3
|
data/lib/mongoid-crud/ext.rb
CHANGED
@@ -49,7 +49,13 @@ module Mongoid
|
|
49
49
|
if !_id.nil?
|
50
50
|
return self._find(_id)#.__send__(self.mongoid_name).create(query)
|
51
51
|
elsif !parent_id.nil?
|
52
|
-
|
52
|
+
var = self._get_class_path(*classes).pinch.last._find(parent_id).__send__(self.mongoid_name)
|
53
|
+
if Mongoid.models.include? var.class
|
54
|
+
return var
|
55
|
+
else
|
56
|
+
return var.where(query)
|
57
|
+
end
|
58
|
+
|
53
59
|
else
|
54
60
|
return self._where(query)
|
55
61
|
end
|
@@ -108,4 +114,4 @@ module Mongoid
|
|
108
114
|
end
|
109
115
|
|
110
116
|
end
|
111
|
-
end
|
117
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-crud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,3 +98,4 @@ signing_key:
|
|
98
98
|
specification_version: 4
|
99
99
|
summary: CRUD on any mongoid model
|
100
100
|
test_files: []
|
101
|
+
has_rdoc:
|