Skip to content

Commit

Permalink
Allow :pool_class option to take a :symbol
Browse files Browse the repository at this point in the history
This allows you to load connection_pool classes via
:pool_class=>:foo, as long as inside the
sequel/connection_pool/foo.rb file, you set
CONNECTION_POOL_MAP[:foo] = self.

No connection pool class currently uses this, but it's possible
nondefault connection pool classes will be added in the future,
and if so, they will need this.
  • Loading branch information
jeremyevans committed Jul 22, 2011
1 parent 8b1f79f commit 749f0ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sequel/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_pool(opts = {}, &block)

# Return a connection pool class based on the given options.
def connection_pool_class(opts)
opts[:pool_class] || CONNECTION_POOL_MAP[[!!opts[:single_threaded], !!opts[:servers]]]
CONNECTION_POOL_MAP[opts[:pool_class]] || opts[:pool_class] || CONNECTION_POOL_MAP[[!!opts[:single_threaded], !!opts[:servers]]]
end
end
extend ClassMethods
Expand Down

0 comments on commit 749f0ba

Please sign in to comment.