diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-05-14 14:09:49 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-05-14 14:09:49 -0500 |
commit | 3b0e1d90938e3d4c98830e037b3da15b3f736f7f (patch) | |
tree | 6e57d3b855939aa800bcac51647ab6906c13b217 /activerecord/lib/active_record/fixtures.rb | |
parent | f32b974338cb965a27d521b32304aebd9811a9ba (diff) | |
download | rails-3b0e1d90938e3d4c98830e037b3da15b3f736f7f.tar.gz rails-3b0e1d90938e3d4c98830e037b3da15b3f736f7f.tar.bz2 rails-3b0e1d90938e3d4c98830e037b3da15b3f736f7f.zip |
Prefer string core_ext inflector methods over directly accessing Inflector.
Diffstat (limited to 'activerecord/lib/active_record/fixtures.rb')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 9367ea523d..ac06cdbe43 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -197,20 +197,20 @@ end # class FooTest < ActiveSupport::TestCase # self.use_transactional_fixtures = true # self.use_instantiated_fixtures = false -# +# # fixtures :foos -# +# # def test_godzilla # assert !Foo.find(:all).empty? # Foo.destroy_all # assert Foo.find(:all).empty? # end -# +# # def test_godzilla_aftermath # assert !Foo.find(:all).empty? # end # end -# +# # If you preload your test database with all fixture data (probably in the Rakefile task) and use transactional fixtures, # then you may omit all fixtures declarations in your test cases since all the data's already there and every case rolls back its changes. # @@ -730,7 +730,7 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) reader.each do |row| data = {} row.each_with_index { |cell, j| data[header[j].to_s.strip] = cell.to_s.strip } - self["#{Inflector::underscore(@class_name)}_#{i+=1}"] = Fixture.new(data, model_class) + self["#{@class_name.to_s.underscore}_#{i+=1}"] = Fixture.new(data, model_class) end end @@ -854,14 +854,14 @@ module Test #:nodoc: require_dependency file_name rescue LoadError => e # Let's hope the developer has included it himself - + # Let's warn in case this is a subdependency, otherwise # subdependency error messages are totally cryptic if ActiveRecord::Base.logger ActiveRecord::Base.logger.warn("Unable to load #{file_name}, underlying cause #{e.message} \n\n #{e.backtrace.join("\n")}") end end - + def require_fixture_classes(table_names = nil) (table_names || fixture_table_names).each do |table_name| file_name = table_name.to_s |