diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-05-21 18:54:51 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-05-21 18:54:51 +0000 |
commit | 96bc3d224d42fdd75d104feadc8f93ae41209fcb (patch) | |
tree | 6a7670c7bab88913a11639bc40b6359d1c6a01b7 /activerecord/lib/active_record | |
parent | d1c957d06744e468c56274e047460e596ef61d73 (diff) | |
download | rails-96bc3d224d42fdd75d104feadc8f93ae41209fcb.tar.gz rails-96bc3d224d42fdd75d104feadc8f93ae41209fcb.tar.bz2 rails-96bc3d224d42fdd75d104feadc8f93ae41209fcb.zip |
Fix column type detection while loading fixtures. Closes #7987 [roderickvd]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6798 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 96fd0c57af..c837fd7b50 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -415,7 +415,7 @@ class Fixture #:nodoc: klass = @class_name.constantize rescue nil list = @fixture.inject([]) do |fixtures, (key, value)| - col = klass.columns_hash[key] if klass.kind_of?(ActiveRecord::Base) + col = klass.columns_hash[key] if klass.respond_to?(:ancestors) && klass.ancestors.include?(ActiveRecord::Base) fixtures << ActiveRecord::Base.connection.quote(value, col).gsub('[^\]\\n', "\n").gsub('[^\]\\r', "\r") end list * ', ' |