tag:help.lighthouseapp.com,2008-09-20:/discussions/problems/24-problem-with-ticketnew-apiLighthouse: Discussion 2011-04-07T05:34:23Ztag:help.lighthouseapp.com,2008-09-20:Comment/102962007-07-11T01:07:50Z2009-06-20T20:55:52ZProblem with Ticket.new API<div><p>You set Lighthouse.account, right? That's a shortcut that sets
the site value on all of the Lighthouse ActiveResource classes.</p></div>Ricktag:help.lighthouseapp.com,2008-09-20:Comment/102962007-07-11T02:02:11Z2009-06-20T20:55:52ZProblem with Ticket.new API<div><p>Yep, Lighthouse.account is set in environment.rb</p>
<p>If I comment the line out, I get the same nil.path error, but it
occurs during ./script/console initialization and I can't even test
the Ticket.new call.</p></div>catwoodtag:help.lighthouseapp.com,2008-09-20:Comment/102962007-07-11T02:15:11Z2009-06-20T20:55:52ZProblem with Ticket.new API<div><p>Well I just found a work around - I don't understand why it
works, but it does</p>
<p>In environment.rb I added:</p>
<pre>
<code>@@tickets = Lighthouse::Ticket</code>
</pre>
<p>and now this line works without the nil.path error:</p>
<pre>
<code>ticket = @@tickets.new(:project_id => 2991)</code>
</pre>
<p>My guess is that the Controller extending ActionController::Base
causes some variable overwrite problem, which the @@ hack above
bypasses. But that is just speculation - I'm too new to rails to
understand its inner workings.</p></div>catwood