tipping: only show tipping sites with paypal/btc input

This commit is contained in:
Kyle Drake 2017-02-25 10:19:14 -08:00
parent 42b3f25b11
commit 3dc38bfc5a
3 changed files with 6 additions and 1 deletions

View file

@ -85,6 +85,7 @@ def browse_sites_dataset
site_dataset.order!(:site_updated_at.desc, :views.desc)
when 'tipping_enabled'
site_dataset.where! tipping_enabled: true
site_dataset.where!("(tipping_paypal is not null and tipping_paypal != '') or (tipping_bitcoin is not null and tipping_bitcoin != '')")
site_dataset = site_dataset.association_left_join :follows
site_dataset.select_all! :sites
site_dataset.select_append! Sequel.lit("count(follows.site_id) AS follow_count")