Active Record 重启父事务
方法
- C
- F
- N
- R
类公共方法
new(connection, parent_transaction, **options) 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 377 def initialize(connection, parent_transaction, **options) super(connection, **options) @parent = parent_transaction if isolation_level raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction" end @parent.state.add_child(@state) end
实例公共方法
commit() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 396 def commit @state.commit! end
full_rollback?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 400 def full_rollback?; false; end
rollback() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 391 def rollback @state.rollback! @parent.restart end