drapergem/draper — pull request #540 by Sam-Serpoosh (2013-05-19 18:07:58+00:00)
Title: Alias object to wrapped model name only if it can.

For instance if the wrapped model is an instance of Product there is
gonna be a method called :product which is aliased to :object.

- In jumpstartlab tutorial on using Draper for Decorator Pattern in rails in the blogger example there was a code that tried using a 'article' method in the ArticleDecorator but I kept getting the error "there is no such method 'article' in ArticleDecorator" so then I jumped into draper source and I saw that in the decorator.rb file there is no part that alias :object to wrapped model name (e.g. :article) or at least I couldn't find it!

- This pull request contains a test and associated code in decorator_spec.rb & decorator.rb for having the wrapped model name method in our decorators (e.g article)!

- It is the first step for this feature and I don't think it's complete or the best way to do that! I appreciate your feedback on it!

Thanks in advance,
Very Best of Regards,