diff options
Diffstat (limited to 'activerecord/lib/active_record/table_metadata.rb')
-rw-r--r-- | activerecord/lib/active_record/table_metadata.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/table_metadata.rb b/activerecord/lib/active_record/table_metadata.rb index 3707fd3f04..6c8792ee80 100644 --- a/activerecord/lib/active_record/table_metadata.rb +++ b/activerecord/lib/active_record/table_metadata.rb @@ -22,12 +22,11 @@ module ActiveRecord arel_table[column_name] end - def column(column_name) + def type(column_name) if klass - klass.columns_hash[column_name.to_s] + klass.type_for_attribute(column_name.to_s) else - # FIXME: We really shouldn't need to do this. - ConnectionAdapters::Column.new(column_name.to_s, nil, Type::Value.new) + Type::Value.new end end |