jsmestad/pivotal-tracker — pull request #42 by rtlong (2011-12-01 12:36:09+00:00)
Title: Unable to create Tasks

Hey there, and thanks for the Gem! I just ran into an issue whereby I couldn't create tasks:

```
002:0 > s = PivotalTracker::Project.find(PROJECT_ID).stories.all.first
#=> #
003:0 > s.tasks.create({ :create => :oe })
ArgumentError: wrong number of arguments(1 for 0)
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `initialize'
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `new'
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `create'
from (irb):3
from /home/ryan/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
004:0 > s.tasks.create( "o" )
NoMethodError: undefined method `merge' for "o":String
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `create'
from (irb):4
from /home/ryan/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
005:0 > s.tasks.create( description: "Test" )
ArgumentError: wrong number of arguments(1 for 0)
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `initialize'
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `new'
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `create'
from (irb):5
from /home/ryan/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
006:0 > s.tasks.create()
ArgumentError: wrong number of arguments(0 for 1)
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `initialize'
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `new'
from /home/ryan/Projects/pivotal-tracker-gem/lib/pivotal-tracker/proxy.rb:36:in `create'
from (irb):5
from /home/ryan/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
```

An odd behavior... was a bit hard to track it down, but I discovered that copying the `initializer` from `Note`
into `Task` fixed the problem. I honestly don't understand what's happening, here, with the Proxy and all that ActiveResource is doing; but, this solved the problem for me. I would guess the initializer was just forgotten in the case?

FTR: This problem _was_ occurring before I cloned it and ran the code from my local FS, which would have been the current release version of the gem.