diff options
author | Paul Hieromnimon <paul.hieromnimon@gmail.com> | 2010-08-10 19:09:24 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-11 15:47:34 -0700 |
commit | 007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1 (patch) | |
tree | 57955aa724aca4531155b777340971e2d9eae3d6 /activerecord/lib | |
parent | 7de03ec765e3160f5331fc17c8d7d332fa679d62 (diff) | |
download | rails-007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1.tar.gz rails-007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1.tar.bz2 rails-007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1.zip |
Raising exception if fixture file can't be found
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index e44102b538..4e49e9f720 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -24,6 +24,8 @@ else end end +class FixturesFileNotFound < StandardError; end + # Fixtures are a way of organizing data that you want to test against; in short, sample data. # # = Fixture formats @@ -696,6 +698,8 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) read_yaml_fixture_files elsif File.file?(csv_file_path) read_csv_fixture_files + else + raise FixturesFileNotFound, "Could not find #{yaml_file_path} or #{csv_file_path}" end end |