Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4752

Show
Ignore:
Timestamp:
08/11/06 23:38:46 (2 years ago)
Author:
rick
Message:

Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r4743 r4752  
    11*SVN* 
     2 
     3* Tweak fixtures so they don't try to use a non-ActiveRecord class.  [Kevin Clark] 
    24 
    35* Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore.  [Rick Olson] 
  • trunk/activerecord/lib/active_record/fixtures.rb

    r4604 r4752  
    396396 
    397397    list = @fixture.inject([]) do |fixtures, (key, value)| 
    398       col = klass.columns_hash[key] unless klass.nil? 
     398      col = klass.columns_hash[key] if klass.kind_of?(ActiveRecord::Base) 
    399399      fixtures << ActiveRecord::Base.connection.quote(value, col).gsub('\\n', "\n").gsub('\\r', "\r") 
    400400    end 
  • trunk/activerecord/test/fixtures_test.rb

    r3866 r4752  
    344344  end 
    345345end 
     346 
     347class DevelopersProject; end; 
     348 
     349class ManyToManyFixturesWithClassDefined < Test::Unit::TestCase 
     350  fixtures :developers_projects 
     351   
     352  def test_this_should_run_cleanly 
     353    assert true 
     354  end 
     355end