dm_filter 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b49e9765e8e98b0bc8ad18f24bd18a14b8ca6e807ec1743a5b6c98b84087f36
4
- data.tar.gz: 1da5786d8475a5718fcc714534d8b0d6fd113ca4afca0d66c61284b085ea4a06
3
+ metadata.gz: 385b280f8c6d2531e62477ad4a7449039a4f815efcd0454402921f619b9855a3
4
+ data.tar.gz: ceae093070645ef1c9f2b555644b840d32e46c2c0cdee51f31c6d1e3a0dda36d
5
5
  SHA512:
6
- metadata.gz: 0be1175f6f9983d22be4a67ed38d39fc6c7fa12797dc92a67745394fd5e603bb25911e54eef7acdcb08a3d55ff6dc40c6d923621826ade57d457fd933a4c123c
7
- data.tar.gz: '054619d31f1ab1fd73373537f4f71579131d08380e77e990cc76dbbbe9124b35e8290ce294982cda5c652a5555569dd01081818039f987ba8a0360b64464cf1e'
6
+ metadata.gz: 42a1aa7197d06e5e21000a6d6ba101d2ea2690f9eee6dc3a16e405dbad05bbb51686bfd9ce63fe4fa994812efa2ad3304f9d5a77592a5d378dc78c84b92bda80
7
+ data.tar.gz: cc104e1e194a3a14ba64bb15dfd69a7aaf1388151c303b5c2a4c40f06d06b07612620703750757f69397d2ff0775ecd5bdf239f38a89dcb6b8670be0246fa69a
data/.gitignore CHANGED
@@ -9,4 +9,4 @@
9
9
  /tmp/
10
10
  .byebug_history
11
11
  .rspec_status
12
- dm_filter-0.0.4.gem
12
+ *.gem
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
  group :test do
7
7
  gem 'activerecord'
8
8
  gem 'byebug'
9
- gem 'mysql2', '>= 0.3.13', '< 0.4.0'
9
+ gem 'mysql2'
10
10
  gem 'rubocop'
11
11
  gem 'simplecov'
12
12
  gem 'simplecov-console'
@@ -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] => from.beginning_of_day..to.end_of_day)
16
+ where(options[:column_date] => Time.current.beginning_of_day..Time.current.end_of_day)
20
17
  when 'yesterday'
21
- where(options[:column_date] => from.yesterday.beginning_of_day..to.yesterday.end_of_day)
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] => from.beginning_of_week..to.end_of_week)
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] => from.beginning_of_month..to.end_of_month)
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] => from.last_month.beginning_of_month..to.last_month.end_of_month)
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
@@ -1,3 +1,3 @@
1
1
  module DmFilter
2
- VERSION = '0.0.5'.freeze
2
+ VERSION = '0.0.6'.freeze
3
3
  end
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.5
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-07-31 00:00:00.000000000 Z
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