lib/safemode/blankslate.rb in safemode-1.0.2 vs lib/safemode/blankslate.rb in safemode-1.1.0
- old
+ new
@@ -1,12 +1,12 @@
module Safemode
class Blankslate
@@allow_instance_methods = ['class', 'inspect', 'methods', 'respond_to?', 'to_s', 'instance_variable_get']
@@allow_class_methods = ['methods', 'new', 'name', 'inspect', '<', 'ancestors', '=='] # < needed in Rails Object#subclasses_of
- silently { undef_methods(*instance_methods - @@allow_instance_methods) }
+ silently { undef_methods(*instance_methods.map(&:to_s) - @@allow_instance_methods) }
class << self
- silently { undef_methods(*instance_methods - @@allow_class_methods) }
+ silently { undef_methods(*instance_methods.map(&:to_s) - @@allow_class_methods) }
def method_added(name) end # ActiveSupport needs this
def inherited(subclass)
subclass.init_allowed_methods(@allowed_methods)