diff options
author | Viktar Basharymau <viktar.basharymau@thehamon.com> | 2014-06-25 13:02:23 +0300 |
---|---|---|
committer | Viktar Basharymau <viktar.basharymau@thehamon.com> | 2014-06-27 17:46:47 +0300 |
commit | 482fdad5ef8a73688b50bba3991dd4ef6f286edd (patch) | |
tree | 17e14bbe81a5d002e728fd0caa8f7219707b2a38 /activerecord/lib/active_record | |
parent | d20b8699e9ba67182f1fc9bbe71bbe8da054370f (diff) | |
download | rails-482fdad5ef8a73688b50bba3991dd4ef6f286edd.tar.gz rails-482fdad5ef8a73688b50bba3991dd4ef6f286edd.tar.bz2 rails-482fdad5ef8a73688b50bba3991dd4ef6f286edd.zip |
Replace String index juggling with Pathname goodness in db:fixtures:load
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 4ccc21e9b4..5c1c70f3d6 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -200,7 +200,7 @@ db_namespace = namespace :db do fixture_files = if ENV['FIXTURES'] ENV['FIXTURES'].split(',') else - Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] } + Pathname.glob("#{fixtures_dir}/**/*.yml").map {|f| f.basename.sub_ext('').to_s } end ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files) |