Don't re-define local methods

This commit is contained in:
Jeff Casimir 2011-07-12 07:50:30 -04:00
parent d50aefe2f8
commit d591716c2a
2 changed files with 6 additions and 4 deletions

View File

@ -49,9 +49,11 @@ module Draper
def build_methods
select_methods.each do |method|
(class << self; self; end).class_eval do
define_method method do |*args, &block|
source.send method, *args, &block
unless self.respond_to(method)
(class << self; self; end).class_eval do
define_method method do |*args, &block|
source.send method, *args, &block
end
end
end
end

View File

@ -1,3 +1,3 @@
module Draper
VERSION = "0.4.0"
VERSION = "0.4.1"
end