diff options
Diffstat (limited to 'activerecord')
-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 |