Skip to content

Instantly share code, notes, and snippets.

@semanticart
Created June 15, 2009 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save semanticart/130161 to your computer and use it in GitHub Desktop.
Save semanticart/130161 to your computer and use it in GitHub Desktop.
class ActiveRecord::Base
def self.find_values opts
sql = self.send(:construct_finder_sql, opts)
self.connection.select_values(sql)
end
end
>> Tagging.find_values(:select => :taggable_id, :limit => 30, :order => 'tagged_at asc')
=> ["1", "3", "6", "6", "6", "10", "10", "10", "11", "11", "11", "10", "10", "10", "10", "10", "13", "13", "13", "13", "13", "13", "15", "15", "15", "15", "15", "15", "15", "15"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment