remiprev/her — pull request #178 by lleger (2013-10-07 19:26:07+00:00)
Title: Add response errors to ActiveModel using ActiveModel::Errors

**What**
This commit adds any response errors (such as those from calling `save`) to the `ActiveModel::Error` collection on the resource.

**Why**
Doing so enables accessing the errors hash via the `errors` attribute and allows the use of helper methods, such as `full_messages`. This also makes the `Her::Model` act more like an ActiveRecord object.

**How**
If the response errors are in an AR-like hash, then they're iterated over and added to the model via [`add`](http://api.rubyonrails.org/classes/ActiveModel/Errors.html#method-i-add) on `ActiveRecord::Error`. For example:
```ruby
# from remote model
{ errors => @user.errors }.to_json

# parsed in @response_errors
{ :errors => { :name => ["should not be blank"] } }
```

This PR includes passing tests and has been integrated into a production app. This was briefly discussed in #138.

**Example**
```ruby
class User
include Her::Model
# validates :name, presence: true (on remote model)
end

@user = User.new
@user.save

@user.errors # => { :name => ["can't be blank"] }
@user.errors.any? # => true
@user.errors.full_messages # => ["Name can't be blank"]
```