method

create

Importance_0
create(pool, initial_table, joins, aliases = nil) public

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/alias_tracker.rb, line 9
      def self.create(pool, initial_table, joins, aliases = nil)
        pool.with_connection do |connection|
          if joins.empty?
            aliases ||= Hash.new(0)
          elsif aliases
            default_proc = aliases.default_proc || proc { 0 }
            aliases.default_proc = proc { |h, k|
              h[k] = initial_count_for(connection, k, joins) + default_proc.call(h, k)
            }
          else
            aliases = Hash.new { |h, k|
              h[k] = initial_count_for(connection, k, joins)
            }
          end
          aliases[initial_table] = 1
          new(connection.table_alias_length, aliases)
        end
      end
Register or log in to add new notes.