Skip to content

Instantly share code, notes, and snippets.

@thescubageek
Created September 19, 2016 19:18
Show Gist options
  • Save thescubageek/965206b8fb3c92f7fc38f42e7b0165cd to your computer and use it in GitHub Desktop.
Save thescubageek/965206b8fb3c92f7fc38f42e7b0165cd to your computer and use it in GitHub Desktop.
finds locations with multiple websites - CMS
def find_multi_website_locations
Location.all.select { |l| Website.where(owner_id: l.id).count > 1 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment