Model should have more priority over connection_hash for connection_class #157

Merged
merged 1 commit into from Nov 2, 2012

Projects

None yet

2 participants

@pftg
Contributor
pftg commented Nov 2, 2012

When connection should get from model through :model attribute, load_config loaded and set connection_hash. After that for connection_class instead of using model value it use connection_hash. All this two cases are bugs. I added fix changes to pull request:

  • Skip load_config for ActiveRecord if model set.
  • If model and connection_hash are set, then should return model value as connection_class instead of connection_hash builder
@pftg pftg Model has more priority over connection_hash
* Skip load_config for ActiveRecord if model set for strategy.
* If model and connection_hash are set, then should return model as connection_class instead of connection_hash builder
21fb66f
@bmabey bmabey merged commit 8aa8526 into DatabaseCleaner:master Nov 2, 2012

1 check failed

default The Travis build failed
Details
@bmabey
Contributor
bmabey commented Nov 2, 2012

Makes sense, and the patch looks good (travis build is in disrepair so you can ignore that). Merged in, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment