Skip to content

Instantly share code, notes, and snippets.

@esbanarango
Created December 29, 2013 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esbanarango/8172946 to your computer and use it in GitHub Desktop.
Save esbanarango/8172946 to your computer and use it in GitHub Desktop.
ActiveRecord::Calculations can receive SQL functions.

ActiveRecord::Calculations can receive SQL functions.

sum("CAST(total AS float)")
average("CAST(total AS float)")

total dataType is String.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment