ahoy_panel 0.0.26 → 0.0.27

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: f2fabbd234afda0dcf7a2d6ceaf50effad8e2f0d13ab187c23670165fa11feb7
4
- data.tar.gz: c22f7c8215ea99e4f2a74a7cc9e72a78505a33d7d506b319a592437094a04eaa
3
+ metadata.gz: 75d645c34be65e95f6dc0398dda76f5909011c65b709596efbfe265b03c367b4
4
+ data.tar.gz: d3f9e0227a2a16701e314d185c88084180b5a0a031f9847243302f0bd2928dd1
5
5
  SHA512:
6
- metadata.gz: a480c83e46527a059b4d79d8ae30ae7bd52a11274ef478ad8191c370a5d967b4a5ad1cf1b2b9cea35d49473d7b6860fe3003601820dfa1fb1e29f46b8a6b245f
7
- data.tar.gz: 29c10a4bb3e2e2672b4226dd055c648f9b1e8de1c6da84164f8404b726aaf32b8925a9fc2db80a34fd367a1f8e452f778c2bd24740202ce3dc387adc80f6c3d7
6
+ metadata.gz: b95e9b5be81ac08d19149bca18751f9a882f6041d7946517d139e96d00a3d323043b4081b51f6a4b294c5aa18b322e81ee6559fc27f8872fda3e872211a297fe
7
+ data.tar.gz: 2a9237745ebabe9c18c5fddf72447cfa672803996043680d7c0c95b12012ce3bf07f8b64a080215a7f8cb3f114f16f7c37b54a3f93d2bbe1b43854d95ea3cbe9
@@ -4,6 +4,7 @@ module AhoyPanel
4
4
  @start_date = params[:start_date].to_date.beginning_of_day
5
5
  @end_date = params[:end_date].blank? ? nil : params[:end_date].to_date.end_of_day
6
6
  @page = params[:page]
7
+ @filtering_params = JSON.parse(params[:filtering_params], symbolize_names: true)
7
8
 
8
9
  @date_range = if @end_date.blank?
9
10
  @start_date..params[:start_date].to_date.end_of_day
@@ -13,6 +14,19 @@ module AhoyPanel
13
14
 
14
15
  @events = ::Ahoy::Event.where(time: @date_range).order(:id)
15
16
 
17
+ @filtering_params.each do |key, value|
18
+ case key
19
+ when :id
20
+ @events = @events.where(id: value.to_i)
21
+ when :visit_id
22
+ @events = @events.where(visit_id: value.to_i)
23
+ when :user_id
24
+ @events = @events.where(user_id: value.to_i)
25
+ when :name
26
+ @events = @events.where("name ilike ?", "%#{value}%")
27
+ end
28
+ end
29
+
16
30
  if @page.present?
17
31
  @events = @events.page(@page)
18
32
  end
@@ -1,3 +1,3 @@
1
1
  module AhoyPanel
2
- VERSION = "0.0.26"
2
+ VERSION = "0.0.27"
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.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Jeon