dm_filter 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +1 -1
- data/lib/dm_filter.rb +7 -8
- data/lib/dm_filter/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385b280f8c6d2531e62477ad4a7449039a4f815efcd0454402921f619b9855a3
|
4
|
+
data.tar.gz: ceae093070645ef1c9f2b555644b840d32e46c2c0cdee51f31c6d1e3a0dda36d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42a1aa7197d06e5e21000a6d6ba101d2ea2690f9eee6dc3a16e405dbad05bbb51686bfd9ce63fe4fa994812efa2ad3304f9d5a77592a5d378dc78c84b92bda80
|
7
|
+
data.tar.gz: cc104e1e194a3a14ba64bb15dfd69a7aaf1388151c303b5c2a4c40f06d06b07612620703750757f69397d2ff0775ecd5bdf239f38a89dcb6b8670be0246fa69a
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/lib/dm_filter.rb
CHANGED
@@ -9,23 +9,22 @@ module DmFilter
|
|
9
9
|
def dm_get(options)
|
10
10
|
options[:column_date] = 'created_at' unless options[:column_date].present?
|
11
11
|
|
12
|
-
from = options[:from].blank? ? Time.current : options[:from].to_datetime
|
13
|
-
to = options[:to].blank? ? Time.current : options[:to].to_datetime
|
14
|
-
|
15
12
|
case options[:duration]
|
16
13
|
when 'all'
|
17
14
|
all
|
18
15
|
when 'today'
|
19
|
-
where(options[:column_date] =>
|
16
|
+
where(options[:column_date] => Time.current.beginning_of_day..Time.current.end_of_day)
|
20
17
|
when 'yesterday'
|
21
|
-
where(options[:column_date] =>
|
18
|
+
where(options[:column_date] => Time.current.yesterday.beginning_of_day..Time.current.yesterday.end_of_day)
|
22
19
|
when 'this_week'
|
23
|
-
where(options[:column_date] =>
|
20
|
+
where(options[:column_date] => Time.current.beginning_of_week..Time.current.end_of_week)
|
24
21
|
when 'this_month'
|
25
|
-
where(options[:column_date] =>
|
22
|
+
where(options[:column_date] => Time.current.beginning_of_month..Time.current.end_of_month)
|
26
23
|
when 'last_month'
|
27
|
-
where(options[:column_date] =>
|
24
|
+
where(options[:column_date] => Time.current.last_month.beginning_of_month..Time.current.last_month.end_of_month)
|
28
25
|
when 'period', 'custom'
|
26
|
+
from = options[:from].blank? ? Time.current : options[:from].to_datetime
|
27
|
+
to = options[:to].blank? ? Time.current : options[:to].to_datetime
|
29
28
|
where(options[:column_date] => from.beginning_of_day..to.end_of_day)
|
30
29
|
else
|
31
30
|
all
|
data/lib/dm_filter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nujian Den Mark Meralpis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- Rakefile
|
86
86
|
- bin/console
|
87
87
|
- bin/setup
|
88
|
+
- builds/dm_filter-0.0.5.gem
|
88
89
|
- dm_filter.gemspec
|
89
90
|
- lib/dm_filter.rb
|
90
91
|
- lib/dm_filter/version.rb
|