The less than venerable `#alias_method_chain` has been deprecated in the latest version of Active Support. Fortunately, we only use it in two places. Replace with the longhand version using `alias_method` for forward compatibility. Not using Module#prepend in order to maintain compatibility with older versions of Ruby.
…alized instance variable
Either "self.collection_parser = PostParser" in the original example needs to be changed to refer to the subsequent PostCollection class (the path I chose) or the PostCollection class needs to be named PostParser. Bottom line is the class name of the class that inherits from ActiveResource::Collection needs to match the name specified as collection_parser.
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, arriving at the need for this essential boilerplate in an initializer: ActiveResource::Base.observers = # ... ActiveResource::Base.instantiate_observers This change packages it up as neatly as ActiveRecord observers in Rails: # In config/application.rb config.active_resource.observers = [:post_observer, :comment_observer] The Railtie will instantiate observers automatically, and reload them for each request in development just like rails-observers does for ActiveRecord.
* master: Updating changelog. Adding `lib/activeresource.rb` to the project.
As documented: > if a Product class `has_one :inventory` calling `Product#inventory` > will generate a request on /products/:product_id/inventory.json. This was implemented in #15, but only implemented and tested for a true Singleton target. It should also work when the target model does not actually include Singleton, e.g. a Post has one Author.
This commit replaces the use of #attributes.keys with #known_attributes in Errors#from_array and Errors#from_hash. This is done so that when ActiveResource grabs errors for attributes defined in the schema, but don't yet exist as an attribute on the object, the error gets assigned to the known attribute instead of the base object.