Skip to content

Instantly share code, notes, and snippets.

@lukemelia
Created June 28, 2011 16:49
Show Gist options
  • Select an option

  • Save lukemelia/1051574 to your computer and use it in GitHub Desktop.

Select an option

Save lukemelia/1051574 to your computer and use it in GitHub Desktop.
diff --git a/lib/caching_presenter.rb b/lib/caching_presenter.rb
index 0b11077..4578511 100644
--- a/lib/caching_presenter.rb
+++ b/lib/caching_presenter.rb
@@ -33,7 +33,11 @@ class CachingPresenter
@cached_instance_methods = Hash.new{ |h,k| h[k] = {}}
write_constructor :presents => @presents, :options => options
%w(class id to_param).each do |method|
- undef_method method if respond_to?(method)
+ begin
+ undef_method method if respond_to?(method)
+ rescue NameError
+ # Under Ruby 1.9, this is failing for to_param. Need to investigate further.
+ end
end
else
@presents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment