Permalink
Browse files

no longer tries to convert empty strings to urls

  • Loading branch information...
1 parent a86c875 commit 7cfc11e7d9e58ba8a37f6b0aba0cae7b82cb75e9 @molte committed Jul 11, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/acts_as_url.rb
View
@@ -25,6 +25,9 @@ def acts_as_url(*attributes)
# Define writer method
define_method((attribute.to_s + '=').to_sym) do |url|
+ # Don't convert an empty string to a url
+ write_attribute(attribute, url) and return if url.blank?
+
# Get provided protocol if any
provided_protocol = protocols[attribute].reject { |p| !url.starts_with?(p) }.first
protocol_included = !provided_protocol.nil?

0 comments on commit 7cfc11e

Please sign in to comment.