Skip to content

Commit 02acd95

Browse files
committed
stop depending on callbacks
1 parent c79c698 commit 02acd95

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

activerecord/lib/active_record/fixtures.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,11 +708,18 @@ module ActiveRecord
708708
module TestFixtures
709709
extend ActiveSupport::Concern
710710

711-
included do
712-
setup :setup_fixtures
713-
teardown :teardown_fixtures
711+
def before_setup
712+
setup_fixtures
713+
super
714+
end
715+
716+
def after_teardown
717+
super
718+
teardown_fixtures
719+
end
714720

715-
class_attribute :fixture_path
721+
included do
722+
class_attribute :fixture_path, :instance_writer => false
716723
class_attribute :fixture_table_names
717724
class_attribute :fixture_class_names
718725
class_attribute :use_transactional_fixtures
@@ -765,8 +772,7 @@ def fixtures(*fixture_set_names)
765772
def try_to_load_dependency(file_name)
766773
require_dependency file_name
767774
rescue LoadError => e
768-
# Let's hope the developer has included it himself
769-
775+
# Let's hope the developer has included it
770776
# Let's warn in case this is a subdependency, otherwise
771777
# subdependency error messages are totally cryptic
772778
if ActiveRecord::Base.logger

0 commit comments

Comments
 (0)