Lighthouse::Ticket#reload broken?
Hi there,
I'm getting a ArgumentError: expected an attributes Hash,
got #<Lighthouse::Ticket::Version:0x17994b4>
error
when trying to reload a single ticket using the lighthouse-api gem.
When I load tickets through the tickets collection on a projects
object, it loads the "light" list of tickets (without the
Ticket::Version collection included). When I call reload on a
single one of these tickets, it bombs with that error.
I think it's because in ARes::Base#reload it tries to update the existing object by calling a find, and then passing the returned attributes hash to ARes::Base#load. If there are nested collections, #load expects them to be represented as hashes that can be passed into a new object, not fully loaded objects (like Ticket::Version). If I use Ticket#find directly it doesn't encounter this problem because it doesn't go through #load. Is this a lighthouse-api issue or an ARes issue? I'm using ARes 2.2.2 and the LH api 1.0.0.
To repro:
tickets = Lighthouse::Project.find(:all).first.tickets # load "light" list of tickets for the first project
tickets.first.reload # tries to reload with the Ticket::Version collection -- KABOOM
Also, I thought I would file a ticket in lighthouse's lighthouse project, but I couldn't find it. Is it publicly accessible?
Thanks!
stevie
Discussions are closed to public comments.
If you need help with Lighthouse please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by stevie on 21 Apr, 2009 12:48 PM
Any help here? Anyone?
2 Posted by Rick on 21 Apr, 2009 03:48 PM
Yea this is definitely an active resource issue. I'd just use a manual find and skip #reload.