Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Explicitly calling .inspect on the regex so that we get the proper fo…
Browse files Browse the repository at this point in the history
…rmat. We don't want Regex#to_s.
  • Loading branch information
augustl committed Mar 9, 2009
1 parent a544e26 commit 1457b57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/live_validations/adapters/jquery_validations.rb
Expand Up @@ -72,7 +72,7 @@ class JqueryValidations < LiveValidations::Adapter
end

validates :format do |v, attribute|
regex = v.format_regex
regex = v.format_regex.inspect
add_custom_rule(v, attribute, Digest::SHA1.hexdigest(regex.inspect), "return #{regex}.test(value)", v.message_for(:invalid))
end

Expand Down

0 comments on commit 1457b57

Please sign in to comment.