Exclude own referring domains from stats #51
Owner
```ruby
# app/controllers/dashboard_controller.rb
# Top 10 referring domains
@top_referring_domains = Ahoy::Visit.where.not(referring_domain:
[ nil, "localhost" ])
.where.not("referring_domain LIKE ?",
"%" + ENV["RAILS_APP"] + "%")
.group(:referring_domain)
.count.sort_by { |domain, count| -count }
.first(10).to_h
@top_referring_domain_all_counter = Ahoy::Visit.where.not(referring_domain: nil)
.where.not("referring_domain LIKE ?",
"%" + ENV["RAILS_APP"] + "%")
.count
```
bug
label
Labels
No labels
bug
config
contribution welcome
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
refactor
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
as-consult/starterkit-8#51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?