Skip to content

Instantly share code, notes, and snippets.

module ActiveRecord
module ConnectionAdapters
module DatabaseStatements
#
# Run the normal transaction method; when it's done, check to see if there
# is exactly one open transaction. If so, that's the transactional
# fixtures transaction; from the model's standpoint, the completed
# transaction is the real deal. Send commit callbacks to models.
#
# If the transaction block raises a Rollback, we need to know, so we don't
module Behaviour
def child_class
Child
end
end
module Family
class Child; end
# No Boom, it was creating the handle first... cause app Boom
# This does however, as you say, "Boom"
Factory.define :product do |p|
p.product_handles do |p|
[Factory.build(:product_handle)]
end
end
# Only issue here is that the product has knowledge of the handle... knowledge it need not have.
<<-BUMBLEBEE
The bumblebee hovers around an object,
looking for a flower with some pollen.
It goes from flower to flower,
trying each method in order,
and when it finds one that isn't empty,
it returns it to the hive.