Flowdock
method

construct_finder_sql_with_included_associations

Importance_0
construct_finder_sql_with_included_associations(options, schema_abbreviations, reflections) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations.rb, line 947
        def construct_finder_sql_with_included_associations(options, schema_abbreviations, reflections)
          sql = "SELECT #{column_aliases(schema_abbreviations)} FROM #{table_name} "
          sql << reflections.collect { |reflection| association_join(reflection) }.to_s
          sql << "#{options[:joins]} " if options[:joins]

          add_conditions!(sql, options[:conditions])
          add_sti_conditions!(sql, reflections)
          add_limited_ids_condition!(sql, options) if !using_limitable_reflections?(reflections) && options[:limit]

          sql << "ORDER BY #{options[:order]} " if options[:order]

          add_limit!(sql, options) if using_limitable_reflections?(reflections)

          return sanitize_sql(sql)
        end
Register or log in to add new notes.