Permalink
Browse files

setup_fixture_accessors should accept symbols for table names. Fixes …

…an unintended (and untested) regression.
  • Loading branch information...
1 parent 7985f64 commit 508493ca458f32517d34369cd93abc6592b29b83 @jeremy jeremy committed Jan 3, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 activerecord/lib/active_record/fixtures.rb
  2. +1 −1 activerecord/test/cases/fixtures_test.rb
View
1 activerecord/lib/active_record/fixtures.rb
@@ -789,6 +789,7 @@ def setup_fixture_accessors(fixture_names = nil)
fixture_names = Array.wrap(fixture_names || fixture_table_names)
methods = Module.new do
fixture_names.each do |fixture_name|
+ fixture_name = fixture_name.to_s
accessor_name = fixture_name.tr('/', '_').to_sym
define_method(accessor_name) do |*fixtures|
View
2 activerecord/test/cases/fixtures_test.rb
@@ -589,7 +589,7 @@ def test_cache
load_extra_fixture('posts')
assert ActiveRecord::Fixtures.fixture_is_cached?(ActiveRecord::Base.connection, 'posts')
- self.class.setup_fixture_accessors('posts')
+ self.class.setup_fixture_accessors :posts
assert_equal 'Welcome to the weblog', posts(:welcome).title
end
end

0 comments on commit 508493c

Please sign in to comment.