aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-05-21 18:54:51 +0000
committerRick Olson <technoweenie@gmail.com>2007-05-21 18:54:51 +0000
commit96bc3d224d42fdd75d104feadc8f93ae41209fcb (patch)
tree6a7670c7bab88913a11639bc40b6359d1c6a01b7 /activerecord/lib/active_record
parentd1c957d06744e468c56274e047460e596ef61d73 (diff)
downloadrails-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-xactiverecord/lib/active_record/fixtures.rb2
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 * ', '