peter-murach/github — pull request #96 by ajsharp (2013-03-21 08:47:22+00:00)
Title: Problems with ResponseWrapper#==

This particular instance of this error occurred when I tried to delete a hook in an active record `before_destroy` hook. The code triggering this is: `client.repos.hooks.delete repo_user, repo_name, remote_id`.

However, a similar NoMethodError for `env` occurred when I tried to assign the result of create a hook to an active record field. It seems that the AR dirty attributes stuff invokes `==`.

Delegating the `==` to `ResponseWrapper#body` fixes that error, but exposes another problem. I'll continue adding to this thread as I learn more.

Here's the backtrace:

```
NoMethodError: undefined method `env' for false:FalseClass
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/github_api-0.9.0/lib/github_api/response_wrapper.rb:121:in `=='
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:408:in `_run__1696145030333590411__destroy__1403214086315189427__callbacks'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/callbacks.rb:254:in `destroy'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/transactions.rb:254:in `block in destroy'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/transactions.rb:208:in `transaction'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
from /Users/ajsharp/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/transactions.rb:254:in `destroy'
```