× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

What is the difference between ActiveRecord transaction block of instance and a class?

<p>There's no difference, the instance method simply delegates the execution to the class method. Here's the code:</p> <pre><code>def transaction(options = {}, &amp;block) self.class.transaction(options, &amp;block) end </code></pre> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/31320464/What%20is%20the%20difference%20between%20ActiveRecord%20transaction%20block%20of%20instance%20and%20a%20class?/31320673">Stack Overflow</a>.</p>
comments powered by Disqus