class ActiveRecord::Base

Politely lifted from fcheung’s selectable_includes plugin for ActiveRecord github.com/fcheung/selectable_includes/blob/master/lib/selectable_includes.rb

Public Class Methods

construct_finder_sql_with_included_associations_with_selectable_includes(options, join_dependency) click to toggle source
# File lib/fake_arel/selectable_includes.rb, line 5
def construct_finder_sql_with_included_associations_with_selectable_includes(options, join_dependency)
  scope = scope(:find)
  select_options = options[:select] || (scope && scope[:select])
  sql = construct_finder_sql_with_included_associations_without_selectable_includes(options, join_dependency)
  unless select_options.blank?
    sql.sub!(/\ASELECT /, "SELECT #{select_options}, ")
  end
  sql
end