Skip to content

Instantly share code, notes, and snippets.

View winton's full-sized avatar

Winton Welsh winton

  • Los Angeles, CA
View GitHub Profile
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# app/controllers/admin/article_requests_controller.rb
query = "
SELECT COUNT(*) AS num_leads_with_tag FROM users
INNER JOIN taggings ON taggings.tag_id = 24
AND taggings.taggable_type = 'User'
AND taggings.taggable_id = users.id
AND (users.interested_in_writing = 'Yes' OR users.interested_in_writing = 'Maybe')
AND ((users.last_contacted_at < #{ActiveRecord::Base.sanitize(4.days.ago)}) OR (users.last_contacted_at is null))
"
Tag.find_by_sql(query)