The following code raises `NameError` error, because the `result` variable is defined only in the transaction scope. ```ruby ActiveRecord::Base.transaction do result = 1 end result # NameError: undefined local variable or method `result' ``` To fix it I need: 1) to define the `result` variable before the transaction block ```ruby result = nil ActiveRecord::Base.transaction do result = 1 end result ``` 2) to assign transaction block to the `result` variable: ```ruby result = ActiveRecord::Base.transaction do 1 end ``` 3) to replace local variable with instance variable: ```ruby ActiveRecord::Base.transaction do @result = 1 end @result ``` Which way is better?