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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/mongoid-crud/ext.rb +8 -2
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 331fed8400ff57e634ccca47b874c965b55aed1f
4
- data.tar.gz: 03530f0bc89d235302527504411913d29f1ed64a
3
+ metadata.gz: beec8ad681d3e1ae3ddf31c1c0652b73d1592a8c
4
+ data.tar.gz: ee017fad081f1432ea1bedc57a613d3f6b86e7b7
5
5
  SHA512:
6
- metadata.gz: 99f142a28d7e9092d050ff591e88adba143416ef97bf933d5eb00d638e541c248813bb8a5d9bfb681f31b88376c179392a3428779ab2c1b42a0e0dfe698fa05a
7
- data.tar.gz: 25d293e5a76241d6dad156889ab290ebb9e0dbdf5cd5a9d9fdce2e7c246459c10b1ced8deb3d7ff8a2d845c5da67d6cab8225a1662294afec4d200b99047962d
6
+ metadata.gz: 7f7bd7c0fbcf7a4db25398f8d65059755de00cd043dcc9b58df6bcd06159b09bef81df1a0784c87b54e6a00726eb49871b19cd1f1b24cab2c1ca184faff1d16f
7
+ data.tar.gz: 724746f00c39839d5944c7e9ab1c50446c8b1a6345468f8f4111c212f1f8ced40393648d5b2fa55b11be0ca61e304bb6910c9906e26e97990d75583d06a7d9d6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
@@ -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
- return self._get_class_path(*classes).pinch.last._find(parent_id).__send__(self.mongoid_name).where(query)
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.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-05-08 00:00:00.000000000 Z
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: