Add private accessor .model method
This commit is contained in:
parent
2ed64ce56f
commit
5dedd370e6
|
@ -43,8 +43,12 @@ module Draper
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def model
|
||||||
|
@model
|
||||||
|
end
|
||||||
|
|
||||||
def select_methods
|
def select_methods
|
||||||
self.allowed || (@model.public_methods - denied)
|
self.allowed || (model.public_methods - denied)
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_methods
|
def build_methods
|
||||||
|
@ -52,7 +56,7 @@ module Draper
|
||||||
unless self.respond_to?(method)
|
unless self.respond_to?(method)
|
||||||
(class << self; self; end).class_eval do
|
(class << self; self; end).class_eval do
|
||||||
define_method method do |*args, &block|
|
define_method method do |*args, &block|
|
||||||
@model.send method, *args, &block
|
model.send method, *args, &block
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
class DecoratorApplicationHelper < Draper::Base
|
|
||||||
def uses_hello
|
|
||||||
self.hello
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue