Closed rainhead closed 10 years ago
needs test
There are problems: Dynamoid::Indexes#index will create the index if it does not already exist. So loading a model with an index can trigger a connection. I'm sure there are similar cases.
This clearly needs rework, but I'm worried about scope creep. Avoiding a connection on configure seems to be enough for our use case.
Working on tests.
looking good
Seems reasonable. I will attempt to merge this soon.
Just because an environment has dynamodb access available and configured does not mean we need to connect. Rake tasks, for example, will often not need the connection, and sometimes have their access to the network restricted.
We should connect to the database the first time it is needed.