diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 4f8204821ce7568bde645a160249cf401b2f261f..4bc7135995552633a07e8fe52d92f62a88c7179d 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com] + * Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net] * Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak] diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index e1bfea2d071091491a45d3b20a4928a16ed3e8dc..6d3170f7bc835983bcc643c40d8a643b1a92aeca 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -367,7 +367,7 @@ class TestCase #:nodoc: self.use_instantiated_fixtures = true def self.fixtures(*table_names) - self.fixture_table_names = table_names.flatten + self.fixture_table_names |= table_names.flatten require_fixture_classes end diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index c83b4babf5ff5bee971509a5076fd2176956fe4f..30acb945d11cfde54871564ed47133964d81c907 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -136,3 +136,23 @@ def test_destroy_just_kidding assert_not_nil @first end end + + +class MultipleFixturesTest < Test::Unit::TestCase + fixtures :topics + fixtures :developers, :accounts + + def test_fixture_table_names + assert_equal([:topics, :developers, :accounts], fixture_table_names) + end +end + + +class OverlappingFixturesTest < Test::Unit::TestCase + fixtures :topics, :developers + fixtures :developers, :accounts + + def test_fixture_table_names + assert_equal([:topics, :developers, :accounts], fixture_table_names) + end +end