Skip to content

Instantly share code, notes, and snippets.

@dburger
Created November 23, 2008 21:27
Show Gist options
  • Save dburger/28215 to your computer and use it in GitHub Desktop.
Save dburger/28215 to your computer and use it in GitHub Desktop.
sql = 'a big honking sql statement'
conditions = conditions_for_doodad
order = "#{params[:order_by]} #{params[:order]}"
Doodad.send(:add_conditions!, sql, conditions)
Doodad.send(:add_order!, sql, order)
@rs = ActiveRecord::Base.connection.select_all(sql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment