Permalink
Browse files

Don't re-define local methods

  • Loading branch information...
1 parent d50aefe commit d591716c2a586c905876b3d6ad172f5cad50e63f @jcasimir jcasimir committed Jul 12, 2011
Showing with 6 additions and 4 deletions.
  1. +5 −3 lib/draper/base.rb
  2. +1 −1 lib/draper/version.rb
View
@@ -49,9 +49,11 @@ def select_methods
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
@@ -1,3 +1,3 @@
module Draper
- VERSION = "0.4.0"
+ VERSION = "0.4.1"
end

0 comments on commit d591716

Please sign in to comment.