Created
March 6, 2014 09:36
-
-
Save alvir/9386179 to your computer and use it in GitHub Desktop.
Raw pluck as alternatives pluck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Base | |
def self.raw_pluck(*args) | |
sql = connection.unprepared_statement { select(args).to_sql } | |
connection.execute(sql).to_a | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment