rails/activeresource — pull request #109 by ches (2013-10-29 14:19:27+00:00)
Title: Instantiate observers via Railtie, and run load hooks

I spent some time figuring out how to cleanly use the ActiveResource observer support in a Rails app, finding surprisingly little documentation beyond `ActiveModel::Observer` itself, eventually arriving at the need for this essential boilerplate in an initializer:

```ruby
ActiveResource::Base.observers = # ...
ActiveResource::Base.instantiate_observers
```

This change packages it up as neatly as ActiveRecord observers in Rails:

```ruby
# In config/application.rb
config.active_resource.observers = [:post_observer, :comment_observer]
```

The Railtie instantiates observers automatically, and reloads them for each request in development just like rails-observers does for ActiveRecord.