diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-14 17:11:52 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-14 17:11:52 -0700 |
commit | 955b26ac6e729d7197f9c5134ad7d438c08293c0 (patch) | |
tree | bb41bf4584c03f14963e8951ff0a8e762f83b8c2 | |
parent | d41a28bcca521222594a70d237935a4415a85230 (diff) | |
download | rails-955b26ac6e729d7197f9c5134ad7d438c08293c0.tar.gz rails-955b26ac6e729d7197f9c5134ad7d438c08293c0.tar.bz2 rails-955b26ac6e729d7197f9c5134ad7d438c08293c0.zip |
primary_key_name already checks for the model_class
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index a2328663fd..5bf43b3a72 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -664,8 +664,8 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) end def has_primary_key_column? - @has_primary_key_column ||= model_class && primary_key_name && - model_class.columns.find { |c| c.name == primary_key_name } + @has_primary_key_column ||= primary_key_name && + model_class.columns.any? { |c| c.name == primary_key_name } end def timestamp_column_names |