diff --git a/Readme.markdown b/Readme.markdown index db08549..bfad4cd 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -198,7 +198,7 @@ Hate seeing that `h.` proxy all over? Willing to mix a bazillion methods into yo ```ruby class ArticleDecorator < ApplicationDecorator decorates :article - lazy_helpers + include Draper::LazyHelpers def published_at date = content_tag(:span, model.published_at.strftime("%A, %B %e").squeeze(" "), :class => 'date') diff --git a/lib/draper/base.rb b/lib/draper/base.rb index 6c108a8..7edddbc 100644 --- a/lib/draper/base.rb +++ b/lib/draper/base.rb @@ -105,16 +105,6 @@ module Draper end alias :h :helpers - # Calling `lazy_helpers` will make the built-in and - # user-defined Rails helpers accessible as class methods - # in the decorator without using the `h.` or `helpers.` proxy. - # - # The drawback is that you dump many methods into your decorator's - # namespace and collisions could create unexpected results. - def self.lazy_helpers - self.send(:include, Draper::LazyHelpers) - end - # Fetch the original wrapped model. # # @return [Object] original_model diff --git a/spec/base_spec.rb b/spec/base_spec.rb index ef9a9ca..de592e0 100644 --- a/spec/base_spec.rb +++ b/spec/base_spec.rb @@ -26,13 +26,6 @@ describe Draper::Base do end end - context(".lazy_helpers") do - it "makes Rails helpers available without using the h. proxy" do - Draper::Base.lazy_helpers - subject.send(:pluralize, 5, "cat").should == "5 cats" - end - end - context(".decorates") do it "sets the model class for the decorator" do ProductDecorator.new(source).model_class.should == Product