Changeset 18

Show
Ignore:
Timestamp:
09/28/2006 08:04:01 PM (2 years ago)
Author:
matthew
Message:

Let's try that again... fix problems when the django theme is given list
columns that don't map to ActiveRecord? columns.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/auto-admin/lib/auto_admin_django_theme.rb

    r17 r18  
    101101    end 
    102102    def table_cell(field_type, field_name, options) 
    103       if field_name 
    104         column = model.find_column(field_name) 
    105         assoc = model.reflect_on_association(field_name.to_sym) 
    106         klass = assoc ? assoc.klass.name.underscore.to_s : column.type.to_s 
    107       else 
    108         klass = '' 
    109       end 
     103      column = model.find_column(field_name) 
     104      assoc = model.reflect_on_association(field_name.to_sym) 
     105 
     106      klass = assoc ? assoc.klass.name.underscore : 
     107              column ? column.type : 
     108              '' 
    110109 
    111110      was_first, @first = @first, false