1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixtures class constantizes this value, so no need to do it twice

This commit is contained in:
Aaron Patterson 2011-02-11 17:02:53 -08:00
parent 24166c2603
commit a5b61269f3

View file

@ -788,9 +788,9 @@ class Fixture #:nodoc:
attr_reader :model_class
def initialize(fixture, model_class, connection = ActiveRecord::Base.connection)
@connection = connection
@fixture = fixture
@model_class = model_class.is_a?(Class) ? model_class : model_class.constantize rescue nil
@connection = connection
@fixture = fixture
@model_class = model_class
end
def class_name