Skip to content

Instantly share code, notes, and snippets.

@phene
Created August 16, 2010 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phene/b9feaa46b078f784ee1f to your computer and use it in GitHub Desktop.
Save phene/b9feaa46b078f784ee1f to your computer and use it in GitHub Desktop.
+++ a/have_sent_email.rb
--- b/have_sent_email.rb
@@ -98,7 +98,7 @@ module Shoulda # :nodoc:
def regexp_or_string_match_in_array(an_array, a_regexp_or_string)
case a_regexp_or_string
when Regexp
- an_array.detect{|e| e =~ a_regexp_or_string}.any?
+ an_array.select{|e| e =~ a_regexp_or_string}.any?
when String
an_array.include?(a_regexp_or_string)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment