Flowdock
method

construct_finder_sql_for_association_limiting

Importance_0
v1.0.0 - Show latest stable - 0 notes - Class: ActiveRecord::Associations::ClassMethods
construct_finder_sql_for_association_limiting(options) 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 976
        def construct_finder_sql_for_association_limiting(options)
          raise(ArgumentError, "Limited eager loads and conditions on the eager tables is incompatible") if include_eager_conditions?(options)
          
          sql = "SELECT #{primary_key} FROM #{table_name} "
          add_conditions!(sql, options[:conditions])
          sql << "ORDER BY #{options[:order]} " if options[:order]
          add_limit!(sql, options)
          return sanitize_sql(sql)
        end
Register or log in to add new notes.