Reuse ActiveRecord connection for migrations. #57

Closed
wants to merge 2 commits into
from

2 participants

@glenngillen

Added a convenience method to set the QC::Conn.connection and then method to switch the connection out for a single block of code. It means QC.load_functions can re-use the already open transaction from the Rails migration.

Considered either forcing the exec("commit") prior to running load_functions or allowing load_functions to optionally run outside of a transaction. Both felt a bit ghetto and could leave the app in a state where an error only did have a rollback and then required manual intervention. Wanted to refrain from forcing those awesome MySQL-esque features on users ;)

Discuss.

@ryandotsmith

Going to pass on this for now. Perhaps we can come back to it for a 2.1 release.

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