Ruby 1.8.7 compatibility

This commit is contained in:
dwbutler 2012-08-27 10:55:29 -07:00
parent 39caec8984
commit 9f8c48b69e

View file

@ -65,7 +65,7 @@ module RoleModel
#
# Defines new methods which call #is?(:role)
def method_missing(name, *args, &block)
if name =~ /^(?:is_)?(.+)\?$/
if name.to_s =~ /^(?:is_)?(.+)\?$/
role = $1.to_sym
self.class.instance_eval do
define_method(name.to_sym) { is? role }