Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Created December 14, 2022 15:38
Show Gist options
  • Select an option

  • Save ashfurrow/f8d6b103a21f4e17c71657f4000fdbac to your computer and use it in GitHub Desktop.

Select an option

Save ashfurrow/f8d6b103a21f4e17c71657f4000fdbac to your computer and use it in GitHub Desktop.

Revisions

  1. ashfurrow created this gist Dec 14, 2022.
    10 changes: 10 additions & 0 deletions rails_console.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    irb(main):026:1* def perform_total_query(domain)
    irb(main):027:1* Follow.joins(:account).merge(Account.where(domain: domain)).count
    irb(main):028:0> end
    irb(main):026:0> inboxes = Account.inboxes
    irb(main):026:0> zero_inboxes = inboxes.select {|i| perform_total_query(i.gsub("https://", '').gsub(
    "http://", "").gsub("/inbox", "")) == 0} # lol whatever
    irb(main):025:0> zero_inboxes.count
    => 12916
    irb(main):026:0> inboxes.count
    => 14895