advanced 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/advanced/active_record.rb +18 -6
- data/lib/advanced/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: 724d8cb29889df2f6de2afe41f73cb9e561e1289
|
4
|
+
data.tar.gz: 48c4f5887dcf0bdf1c6f283f83f00563bb44c549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5725b13768e2bf2f4fa7adbfb3c940709de00a0968fd66f7552a3804db63f0f9ee64531b9bd647d8f5cef3d79d6fa1cb7c453aab8ba0904e22c8fc430705bb32
|
7
|
+
data.tar.gz: 134cbb8a9e80be41ae76ce7c88dd33b4cf816e94bd11fdc2c8f96347a0c7e2ed5d7b215906bb8f56e0522366ff2ef68d1eabe9667bf0097fa948748bc65a7db5
|
@@ -14,15 +14,27 @@ module Advanced
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def where_lt(
|
18
|
-
|
19
|
-
where(arel_table[column].lt(value))
|
20
|
-
end
|
17
|
+
def where_lt(*args)
|
18
|
+
where_arel(:lt, *args)
|
21
19
|
end
|
22
20
|
|
23
|
-
def where_gt(
|
21
|
+
def where_gt(*args)
|
22
|
+
where_arel(:gt, *args)
|
23
|
+
end
|
24
|
+
|
25
|
+
def where_lteq(*args)
|
26
|
+
where_arel(:lteq, *args)
|
27
|
+
end
|
28
|
+
|
29
|
+
def where_gteq(*args)
|
30
|
+
where_arel(:gteq, *args)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def where_arel(meth, param, column: param)
|
24
36
|
define_search param, [param] do |value|
|
25
|
-
where(arel_table[column].
|
37
|
+
where(arel_table[column].send(meth, value))
|
26
38
|
end
|
27
39
|
end
|
28
40
|
end
|
data/lib/advanced/version.rb
CHANGED