Permalink
Browse files

use array intersection for dry / faster code

  • Loading branch information...
tenderlove committed Jul 15, 2010
1 parent 1db8ed0 commit d41a28bcca521222594a70d237935a4415a85230
Showing with 2 additions and 3 deletions.
  1. +2 −3 activerecord/lib/active_record/fixtures.rb
@@ -669,9 +669,8 @@ def has_primary_key_column?
end
def timestamp_column_names
- @timestamp_column_names ||= %w(created_at created_on updated_at updated_on).select do |name|
- column_names.include?(name)
- end
+ @timestamp_column_names ||=
+ %w(created_at created_on updated_at updated_on) & column_names
end
def inheritance_column_name

0 comments on commit d41a28b

Please sign in to comment.