I'm using rails console to debug an issue. What works with the rails server errors in rails console and I can not figure out why.
My code:
email = "team@mysite.com"
user_rules = [/\+/, /\-/, /all/, /updates/, /team/]
user, domain = email.downcase.split('@')
user_rules.each { |rule| return false if !user.match(rule).nil? }
The last line errors with:
1.9.3-p125 :016 > user_rules.each { |rule| return false if !user.match(rule).nil?}
LocalJumpError: unexpected return
from (irb):16:in `block in irb_binding'
from (irb):16:in `each'
from (irb):16
Any ideas why?