method

generate_schema_abbreviations

rails latest stable - Class: ActiveRecord::Associations::ClassMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1.0.0) is shown here.

generate_schema_abbreviations(reflections)
private

No documentation available.

# File activerecord/lib/active_record/associations.rb, line 912
        def generate_schema_abbreviations(reflections)
          schema = [ [ table_name, column_names ] ]
          schema += reflections.collect { |r| [ r.table_name, r.klass.column_names ] }

          schema_abbreviations = {}
          schema.each_with_index do |table_and_columns, i|
            table, columns = table_and_columns
            columns.each_with_index { |column, j| schema_abbreviations["t#{i}_r#{j}"] = [ table, column ] }
          end
          
          return schema_abbreviations
        end