ActiveRecord#Base.find(:include) returns nil.
---------------------------------------------
Key: JRUBY-1521
URL: http://jira.codehaus.org/browse/JRUBY-1521
Project: JRuby
Issue Type: Bug
Components: ActiveRecord-JDBC
Affects Versions: JRuby 1.1b1
Reporter: Mark Imbriaco
Assignee: Thomas E Enebo
Attachments: eager-test.zip
When using eager loading (ActiveRecord::Base.find(..., :include =>
:association), a model class is returned with all of it's attributes set to
nil. A minimal test case against Rails 1.2.5 is included.
MRI 1.8.6, mysql adapter, mysql-client:
% ruby test/unit/parent_test.rb
Loaded suite test/unit/parent_test
Started
..
Finished in 0.058442 seconds.
2 tests, 4 assertions, 0 failures, 0 errors
JRuby 1.1b1 (trunk), ActiveRecord-JDBC, MySQL Connector/J 5.1.5:
% jruby test/unit/parent_test.rb
Loaded suite test/unit/parent_test
Started
F.
Finished in 0.66 seconds.
1) Failure:
test_eager_loading(ParentTest)
[/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/assertions.rb:48:in
`assert_block'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/assertions.rb:46:in
`_wrap_assertion'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/assertions.rb:46:in
`assert_block'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/assertions.rb:46:in
`assert_not_nil'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/assertions.rb:354:in
`test_eager_loading'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in
`each'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in
`each'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in
`run_suite'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`start_mediator'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
`start'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
`run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/autorunner.rb:200:in
`run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit/autorunner.rb:13:in
`run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit.rb:278:in `run'
/Users/mark/workspace/jruby/lib/ruby/1.8/test/unit.rb:276]:
<nil> expected to not be nil.
2 tests, 4 assertions, 1 failures, 0 errors
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email