active_record: performance improvements

Construct the transaction association manually instead of using
ActiveRecord's magic.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>