mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
setup_fixture_accessors should accept symbols for table names. Fixes an unintended (and untested) regression.
This commit is contained in:
parent
7985f64e25
commit
508493ca45
2 changed files with 2 additions and 1 deletions
|
@ -789,6 +789,7 @@ module ActiveRecord
|
|||
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|
|
||||
|
|
|
@ -589,7 +589,7 @@ class FasterFixturesTest < ActiveRecord::TestCase
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue