Skip to content

Commit

Permalink
db:fixtures:load refactoring: remove unnecessary loop
Browse files Browse the repository at this point in the history
`ActiveRecord::FixtureSet.create_fixtures` can accept an array of
fixture_files.
  • Loading branch information
Viktar Basharymau committed Jun 27, 2014
1 parent 5a4df80 commit d20b869
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions activerecord/lib/active_record/railties/databases.rake
Expand Up @@ -203,9 +203,7 @@ db_namespace = namespace :db do
Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] }
end

fixture_files.each do |fixture_file|
ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_file)
end
ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files)
end

# desc "Search for a fixture given a LABEL or ID. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
Expand Down

0 comments on commit d20b869

Please sign in to comment.