Parent

Methods

Files

Class Index [+]

Quicksearch

Arel::Sql::Christener

Public Class Methods

new() click to toggle source
   # File lib/arel/engines/sql/christener.rb, line 4
4:       def initialize
5:         @names = {}
6:       end

Public Instance Methods

name_for(relation) click to toggle source
    # File lib/arel/engines/sql/christener.rb, line 8
 8:       def name_for(relation)
 9:         table = relation.table
10:         name = table.table_alias || table.name
11:         list = @names[name] ||= []
12: 
13:         list << table unless list.include? table
14: 
15:         idx = list.index table
16:         name + (idx == 0 ? '' : "_#{idx + 1}")
17:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.