Class: ActiveRecord::Base
- Defined in:
- lib/fake_arel/selectable_includes.rb
Overview
Politely lifted from fcheung’s selectable_includes plugin for ActiveRecord github.com/fcheung/selectable_includes/blob/master/lib/selectable_includes.rb
Class Method Summary collapse
Class Method Details
.construct_finder_sql_with_included_associations_with_selectable_includes(options, join_dependency) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/fake_arel/selectable_includes.rb', line 5 def construct_finder_sql_with_included_associations_with_selectable_includes(, join_dependency) scope = scope(:find) = [:select] || (scope && scope[:select]) sql = construct_finder_sql_with_included_associations_without_selectable_includes(, join_dependency) unless .blank? sql.sub!(/\ASELECT /, "SELECT #{}, ") end sql end |