has_many association's collection's Enumerable methods don't work
-----------------------------------------------------------------
Key: JRUBY-2875
URL: http://jira.codehaus.org/browse/JRUBY-2875
Project: JRuby
Issue Type: Bug
Components: ActiveRecord-JDBC
Affects Versions: ActiveRecord-JDBC 0.8.2
Reporter: Darcy Schultz
require 'rubygems'
gem 'activerecord'
gem 'activerecord-jdbc-adapter'
require 'active_record'
ActiveRecord::Base.establish_connection({
:adapter => 'mysql',
:driver => 'com.mysql.jdbc.Driver',
:host => 'localhost',
:database => 'sandbox_dev',
:username => 'root'
})
class Person < ActiveRecord::Base; has_many :addresses; end
class Address < ActiveRecord::Base; belongs_to :person; end
person = Person.find :first
puts person.addresses.first.street1
puts person.addresses.min{|a,b| a.street1 <=> b.street1}
The last line creates "undefined method `street1' for #<Array:0x5fb3b4>
(NoMethodError)" exception in JRuby 1.1.3 and ActiveRecord-JDBC 0.8.2 with
Rails 2.1.0
--
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