Active Record 连接适配器 Transaction
状态
方法
- A
- C
- F
- I
- N
- R
类公共方法
new(state = nil) 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 9 def initialize(state = nil) @state = state @children = nil end
实例公共方法
add_child(state) 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 14 def add_child(state) @children ||= [] @children << state end
commit!() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 66 def commit! @state = :committed end
committed?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 23 def committed? @state == :committed || @state == :fully_committed end
completed?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 47 def completed? committed? || rolledback? end
finalized?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 19 def finalized? @state end
full_commit!() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 70 def full_commit! @state = :fully_committed end
full_rollback!() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 56 def full_rollback! @children&.each { |c| c.rollback! } @state = :fully_rolledback end
fully_committed?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 27 def fully_committed? @state == :fully_committed end
fully_completed?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 43 def fully_completed? completed? end
fully_rolledback?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 35 def fully_rolledback? @state == :fully_rolledback end
invalidate!() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 61 def invalidate! @children&.each { |c| c.invalidate! } @state = :invalidated end
invalidated?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 39 def invalidated? @state == :invalidated end
nullify!() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 74 def nullify! @state = nil end
rollback!() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 51 def rollback! @children&.each { |c| c.rollback! } @state = :rolledback end
rolledback?() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 31 def rolledback? @state == :rolledback || @state == :fully_rolledback end