dao-repository 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dao/repository/base.rb +10 -6
- data/lib/dao/repository/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2d02019d262a0867dc9fa96dc5364c34e09ebf7
|
4
|
+
data.tar.gz: 5ef740be7f00a0d171a2efe5186e4fae02c9b7d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dc9076f70640c23176a226a6fdfa96335c53f6ddd0a7a73954ea398feb24c54a322edb5f4bbc704818f49b38f293e8b526c8436e6b7a372705b69e85c5cf2f0
|
7
|
+
data.tar.gz: bb7470f28110c84e2e137aaf777eaa715d60f7f69c6f1fcc10317f1b2bd6d0ce94f10cd520e663c56dab5a116b95413217837d16e0a4b76b917f473fdf693fc2
|
data/lib/dao/repository/base.rb
CHANGED
@@ -21,9 +21,11 @@ module Dao
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def find(id, with: nil)
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
if with
|
25
|
+
scope.find(id, with: with).apply
|
26
|
+
else
|
27
|
+
scope.find(id).apply
|
28
|
+
end
|
27
29
|
end
|
28
30
|
|
29
31
|
def find_by_id(id)
|
@@ -31,9 +33,11 @@ module Dao
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def last(with: nil)
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
if with
|
37
|
+
scope.last(with: with).apply
|
38
|
+
else
|
39
|
+
scope.last.apply
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
def count
|