Cannot call to_yaml on ActiveRecord object with has_many with Rails 2.0
-----------------------------------------------------------------------
Key: JRUBY-1518
URL: http://jira.codehaus.org/browse/JRUBY-1518
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.0.2
Environment: CentOS 5, ruby 1.8.5 (2007-11-03 rev 4810)
[i386-jruby1.0.2]
Rails 2.0 is installed:
[EMAIL PROTECTED] rfs]$ gem list
*** LOCAL GEMS ***
actionmailer (1.3.5.7919, 1.3.5)
Service layer for easy email delivery and testing.
actionpack (1.13.5.7919, 1.13.5)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (1.2.5)
Web service support for Action Pack.
activerecord (1.15.5.7919, 1.15.5)
Implements the ActiveRecord pattern for ORM.
ActiveRecord-JDBC (0.5)
JDBC adapter for ActiveRecord, for use within JRuby on Rails.
activeresource (0.9.0.7919)
Think Active Record for web resources.
activesupport (1.4.4.7919, 1.4.4)
Support and utility classes used by the Rails framework.
aws-s3 (0.4.0)
Client library for Amazon's Simple Storage Service's REST API
builder (2.1.2)
Builders for MarkUp.
daemons (1.0.8)
A toolkit to create and control daemons in different ways
highline (1.4.0)
HighLine is a high-level command-line IO library.
hoe (1.3.0)
Hoe is a way to write Rakefiles much easier and cleaner.
jruby-openssl (0.0.4)
JRuby OpenSSL
mime-types (1.15)
Manages a MIME Content-Type that will return the Content-Type for a
given filename.
mocha (0.5.5)
Mocking and stubbing library
multi (0.1)
Multiple Dispatch/Pattern Matching for Ruby
named_arguments (0.0.5)
The author was too lazy to write a summary
needle (1.3.0)
Needle is a Dependency Injection/Inversion of Control container for
Ruby. It supports both type-2 (setter) and type-3 (constructor)
injection. It takes advantage of the dynamic nature of Ruby to
provide a rich and flexible approach to injecting dependencies.
net-sftp (1.1.0)
Net::SFTP is a pure-Ruby implementation of the SFTP client protocol.
net-ssh (1.1.2)
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
open4 (0.9.6)
open4
optiflag (0.6.5)
OptiFlag is an embeddable DSL library for declaring and using
command-line options/flags in any Ruby program.
rails (1.2.5.7919, 1.2.5)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.7.3)
Ruby based make-like utility.
restphone (0.0.1)
RESTPhone adds a telephone interface to your Ruby on Rails
applications.
right_aws (1.4.3)
Interface classes for the Amazon EC2, SQS, and S3 Web Services
right_http_connection (1.2.0)
RightScale's robust HTTP/S connection module
rspec (1.0.8)
RSpec-1.0.8 (r2338) - BDD for Ruby http://rspec.rubyforge.org/
rubyforge (0.4.4)
A script which automates a limited set of rubyforge operations.
sources (0.0.1)
This package provides download sources for remote gem installation
sqlup (0.0.13)
A backup tool for saving MySQL data to Amazon's S3 service
test-spec (0.4.0)
test/spec layers an RSpec-inspired interface on top of Test::Unit,
so you can mix TDD and BDD (Behavior-Driven Development). test/spec
is a clean-room implementation that maps most kinds of Test::Unit
assertions to a `should'-like syntax.
tzinfo (0.3.5)
Daylight-savings aware timezone library
vlad (1.1.0)
Vlad the Deployer is pragmatic application deployment automation,
without mercy. Much like Capistrano, but with 1/10th the complexity.
Vlad integrates seamlessly with Rake, and uses familiar and standard
tools like ssh and rsync.
xml-simple (1.0.11)
A very simple API for XML processing.
[EMAIL PROTECTED] rfs]$
Reporter: James Moore
Assignee: Thomas E Enebo
Priority: Critical
Attachments: tstproj.tar.gz
Create an object with a has_many relationship, then call to_yaml on it.
require File.dirname(__FILE__) + '/../test_helper'
class FooTest < Test::Unit::TestCase
# Replace this with your real tests.
def test_truth
f = Foo.create :name => 'f1'
b = f.bars.create(:barname => 'b')
f.to_yaml
end
end
You'll see:
1) Error:
test_truth(FooTest):
NoMethodError: undefined method `value' for #<String:0x62ad0d>
/tmp/tst/./test/unit/foo_test.rb:8:in `test_truth'
(I've included a project that repros the issue)
--
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