mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Add private accessor .model method
This commit is contained in:
parent
2ed64ce56f
commit
5dedd370e6
2 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
class DecoratorApplicationHelper < Draper::Base
|
||||
def uses_hello
|
||||
self.hello
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue