Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't re-define local methods

  • Loading branch information...
commit d591716c2a586c905876b3d6ad172f5cad50e63f 1 parent d50aefe
@jcasimir jcasimir authored
Showing with 6 additions and 4 deletions.
  1. +5 −3 lib/draper/base.rb
  2. +1 −1  lib/draper/version.rb
View
8 lib/draper/base.rb
@@ -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
View
2  lib/draper/version.rb
@@ -1,3 +1,3 @@
module Draper
- VERSION = "0.4.0"
+ VERSION = "0.4.1"
end
Please sign in to comment.
Something went wrong with that request. Please try again.