Created
April 19, 2017 19:36
-
-
Save tpope/1610e14266ca9eaaddaefe9adf665f12 to your computer and use it in GitHub Desktop.
This file contains 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
ActiveRecord::Base.connection.select_all(scope.arel).tap do |result| | |
result.map do |attrs| | |
attrs.each do |k, v| | |
attrs[k] = result.column_types[k].type_cast(v) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment