Created
April 19, 2017 19:36
-
-
Save tpope/1610e14266ca9eaaddaefe9adf665f12 to your computer and use it in GitHub Desktop.
Revisions
-
tpope created this gist
Apr 19, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ 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