diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2013-08-23 16:56:58 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2013-08-23 16:56:58 -0700 |
commit | 8f7b3e166a3e5fe072263a5b7d4e115c1a49c2d4 (patch) | |
tree | bed5c0a1609c7b49da56b8b0906555b54a099ea2 | |
parent | 3abeaf0e3bb97c435ce2acfd9cb97786f34f8319 (diff) | |
parent | 92b0ce942f995de0988b998d1780fb8844fda1c9 (diff) | |
download | rails-8f7b3e166a3e5fe072263a5b7d4e115c1a49c2d4.tar.gz rails-8f7b3e166a3e5fe072263a5b7d4e115c1a49c2d4.tar.bz2 rails-8f7b3e166a3e5fe072263a5b7d4e115c1a49c2d4.zip |
Merge pull request #12000 from wangjohn/deprecating_class_name_string_in_fixtures
Deprecating passing strings as class name in fixtures.
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index b2a81a184a..eb89e3875f 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -507,6 +507,7 @@ module ActiveRecord if class_name.is_a?(Class) # TODO: Should be an AR::Base type class, or any? @model_class = class_name else + ActiveSupport::Deprecation.warn("The ability to pass in strings as a class name will be removed in Rails 4.1, consider using the class itself instead.") @model_class = class_name.constantize rescue nil end @@ -743,13 +744,6 @@ module ActiveRecord # 'namespaced/fixture' => Another::Model # # The keys must be the fixture names, that coincide with the short paths to the fixture files. - #-- - # It is also possible to pass the class name instead of the class: - # set_fixture_class 'some_fixture' => 'SomeModel' - # I think this option is redundant, i propose to deprecate it. - # Isn't it easier to always pass the class itself? - # (2011-12-20 alexeymuranov) - #++ def set_fixture_class(class_names = {}) self.fixture_class_names = self.fixture_class_names.merge(class_names.stringify_keys) end |