Add private accessor .model method

This commit is contained in:
Jeff Casimir 2011-07-23 07:33:08 -07:00
parent 2ed64ce56f
commit 5dedd370e6
2 changed files with 6 additions and 7 deletions

View File

@ -43,8 +43,12 @@ module Draper
end
private
def model
@model
end
def select_methods
self.allowed || (@model.public_methods - denied)
self.allowed || (model.public_methods - denied)
end
def build_methods
@ -52,7 +56,7 @@ module Draper
unless self.respond_to?(method)
(class << self; self; end).class_eval do
define_method method do |*args, &block|
@model.send method, *args, &block
model.send method, *args, &block
end
end
end

View File

@ -1,5 +0,0 @@
class DecoratorApplicationHelper < Draper::Base
def uses_hello
self.hello
end
end