ahoy_panel 0.0.20 → 0.0.21

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: 14e70a946cda4c1d38e3076f597a27d7f2833fd9b8311d16917512c14580f99d
4
- data.tar.gz: 04e3ef4321a1017982e07cb1cfe85717b68cee79afccfd3e4c5fa30fb9663973
3
+ metadata.gz: 6538d11adf1b049eaac5bc5bbb7fe702ee0dd53da0e469666b965bbea4e01cd4
4
+ data.tar.gz: 5a282d6d577d9a4157fe3b38a30aaf57238384c9819f9c9b3a405202b6aa487a
5
5
  SHA512:
6
- metadata.gz: fd745aa561acb937c2b7c757b6ec32fe3ae07802a4aa7e4eddb5f59fc8cdb7d8ffa329fa788192cb05a8d537639efe7e609b57c9e6b08aadf93fad421f5e9bff
7
- data.tar.gz: 725fceed6909a44884685c46b1a37b175fec8579ec011f159a784475f4f4bba8aa3f8745108c154a301a4579c5ed57d86e547318563078ef04cacf313c0b8e6d
6
+ metadata.gz: c7b2c01449300afe2c4305878c0c66850f654ebd53694bcaaf67496d7a1ac5969adba3ac3572752fca0cdb83f73e132cd247427e21b38bb3d23769bb113c70ed
7
+ data.tar.gz: 9d60a554a92a50131f96b598e3baa32dc8efb6f5f512da5c4df381499693ed9537dbb6dcaf9f393180d09014f38fa021f2f59ed11acec8830eb6aee3aef88529
@@ -2,10 +2,16 @@ module AhoyPanel
2
2
  class EventsController < ApplicationController
3
3
  def index
4
4
  @start_date = params[:start_date].to_date.beginning_of_day
5
- @end_date = params[:end_date].to_date.end_of_day
5
+ @end_date = params[:end_date].blank? ? nil : params[:end_date].to_date.end_of_day
6
6
  @page = params[:page]
7
7
 
8
- @events = ::Ahoy::Event.where(time: @start_date..@end_date).order(:id)
8
+ @date_range = if @end_date.blank?
9
+ @start_date..params[:start_date].to_date.end_of_day
10
+ else
11
+ @start_date..@end_date
12
+ end
13
+
14
+ @events = ::Ahoy::Event.where(time: @date_range).order(:id)
9
15
 
10
16
  if @page.present?
11
17
  @events = @events.page(@page)
@@ -2,10 +2,16 @@ module AhoyPanel
2
2
  class VisitsController < ApplicationController
3
3
  def index
4
4
  @start_date = params[:start_date].to_date.beginning_of_day
5
- @end_date = params[:end_date].to_date.end_of_day
5
+ @end_date = params[:end_date].blank? ? nil : params[:end_date].to_date.end_of_day
6
6
  @page = params[:page]
7
7
 
8
- @visits = ::Ahoy::Visit.where(started_at: @start_date..@end_date).order(:id)
8
+ @date_range = if @end_date.blank?
9
+ @start_date..params[:start_date].to_date.end_of_day
10
+ else
11
+ @start_date..@end_date
12
+ end
13
+
14
+ @visits = ::Ahoy::Visit.where(started_at: @date_range).order(:id)
9
15
 
10
16
  if @page.present?
11
17
  @visits = @visits.page(@page)
@@ -1,3 +1,3 @@
1
1
  module AhoyPanel
2
- VERSION = "0.0.20"
2
+ VERSION = "0.0.21"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoy_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Jeon