Permalink
Browse files

Better error message in case port is no Numeric value

This will show the user that the port specified in
DataMapper.setup is expected to understand #to_int,
which implies that a Numeric value should be used
as port number.
  • Loading branch information...
1 parent 6276239 commit 8216431a95bfff61d47dfdf6b93d2b60cb46b61f @snusnu snusnu committed Mar 22, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/dm-core/adapters/data_objects_adapter.rb
@@ -207,6 +207,9 @@ def normalized_uri
query = @options.except(:adapter, :user, :password, :host, :port, :path, :fragment, :scheme, :query, :username, :database)
query = nil if query.empty?
+ # Better error message in case port is no Numeric value
+ @options[:port] = @options[:port].to_int if @options[:port]
+
DataObjects::URI.new(
@options[:adapter],
@options[:user] || @options[:username],

0 comments on commit 8216431

Please sign in to comment.