lib/active_graph/node/has_n.rb in activegraph-10.0.0.pre.beta.3 vs lib/active_graph/node/has_n.rb in activegraph-10.0.0.pre.beta.4
- old
+ new
@@ -444,11 +444,11 @@
define_method("#{name}=") do |other_nodes|
association_proxy_cache.clear
clear_deferred_nodes_for_association(name)
- self.class.run_transaction { association_proxy(name).replace_with(other_nodes) }
+ ActiveGraph::Base.transaction { association_proxy(name).replace_with(other_nodes) }
end
end
def define_has_many_id_methods(name)
define_method_unless_defined("#{name.to_s.singularize}_ids") do
@@ -522,10 +522,10 @@
def define_has_one_setter(name)
define_method("#{name}=") do |other_node|
if persisted?
other_node.save if other_node.respond_to?(:persisted?) && !other_node.persisted?
association_proxy_cache.clear # TODO: Should probably just clear for this association...
- self.class.run_transaction { association_proxy(name).replace_with(other_node) }
+ ActiveGraph::Base.transaction { association_proxy(name).replace_with(other_node) }
# handle_non_persisted_node(other_node)
else
defer_create(name, other_node, clear: true)
other_node
end