coerce in Rfm 1.4.1 takes a second resultset parameter but does not check for empty array

8 views
Skip to first unread message

mech

unread,
Jul 2, 2010, 3:12:55 AM7/2/10
to RFM Community
This will result in

NoMethodError: undefined method `server' for []:Rfm::Resultset

error if the resultset happen to be an empty array.

mech

unread,
Jul 2, 2010, 3:35:09 AM7/2/10
to RFM Community
Could it be the Resultset do not have attr_reader for :server?

lardawge

unread,
Jul 2, 2010, 11:00:18 AM7/2/10
to RFM Community

This error has been around long before 1.4.1 for me. Unfortunately I
have never been able to reproduce it. If you can consistently make it
happen and can provide the XML response from the server or a failing
spec, I would be happy to fix it.

mech

unread,
Jul 3, 2010, 3:30:19 AM7/3/10
to RFM Community
Hi larry,

I managed to fix it by just adding a new attr_reader for server
because from what I see, you just do not have a "server" reader method
only.

File: resultset.rb

attr_reader :layout, :server # at line 41

def initialize(server, xml_response, layout, portals=nil)
@server = server # added this at around line 70
@layout = layout

From what I see, it is just a case of missing attribute named "server"
so do not think is an error that you encounter in the past :)

mech
2010

lardawge

unread,
Jul 3, 2010, 12:53:45 PM7/3/10
to RFM Community
Your right. I was referring to a similar error I've been having in one
of my apps that's unrelated to this. Will push out 1.4.1.1 when I get
Internet access on my laptop.

Thanks!

mech

unread,
Jul 6, 2010, 10:02:09 AM7/6/10
to RFM Community
That is cool, will test on my app :)
Reply all
Reply to author
Forward
0 new messages