aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-04-03 20:02:09 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2013-04-04 13:56:18 -0700
commit02acd95d5700ea868c34f5d260882fda3cc836d3 (patch)
tree026c23170350bca38af0c7913c10df7138036f7d
parentc79c6980647eb76bfa52178711fb04ba7e9d403b (diff)
downloadrails-02acd95d5700ea868c34f5d260882fda3cc836d3.tar.gz
rails-02acd95d5700ea868c34f5d260882fda3cc836d3.tar.bz2
rails-02acd95d5700ea868c34f5d260882fda3cc836d3.zip
stop depending on callbacks
-rw-r--r--activerecord/lib/active_record/fixtures.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index c26fc76515..45dc26f0ed 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -708,11 +708,18 @@ module ActiveRecord
module TestFixtures
extend ActiveSupport::Concern
- included do
- setup :setup_fixtures
- teardown :teardown_fixtures
+ def before_setup
+ setup_fixtures
+ super
+ end
+
+ def after_teardown
+ super
+ teardown_fixtures
+ end
- class_attribute :fixture_path
+ included do
+ class_attribute :fixture_path, :instance_writer => false
class_attribute :fixture_table_names
class_attribute :fixture_class_names
class_attribute :use_transactional_fixtures
@@ -765,8 +772,7 @@ module ActiveRecord
def try_to_load_dependency(file_name)
require_dependency file_name
rescue LoadError => e
- # Let's hope the developer has included it himself
-
+ # Let's hope the developer has included it
# Let's warn in case this is a subdependency, otherwise
# subdependency error messages are totally cryptic
if ActiveRecord::Base.logger