Unpersisted

Constants

Methods

#clear_deferred_nodes_for_association

def clear_deferred_nodes_for_association(association_name)
  deferred_nodes_for_association(association_name.to_sym).clear
end

#defer_create

def defer_create(association_name, object, options = {})
  clear_deferred_nodes_for_association(association_name) if options[:clear]

  deferred_nodes_for_association(association_name) << object
end
#deferred_create_cache

The values in this Hash are returned and used outside by reference so any modifications to the Array should be in-place

def deferred_create_cache
  @deferred_create_cache ||= {}
end

#deferred_nodes_for_association

def deferred_nodes_for_association(association_name)
  deferred_create_cache[association_name.to_sym] ||= []
end

#pending_deferred_creations?

def pending_deferred_creations?
  !deferred_create_cache.values.all?(&:empty?)
end