public
Last active — forked from semanticart/find_values.rb

  • Download Gist
find_values.rb
Ruby
1 2 3 4 5 6 7 8 9
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"]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.