Module: ArCache::ActiveRecord::ConnectionAdapters::TransactionManager
- Defined in:
- lib/ar_cache/active_record/connection_adapters/abstract/transaction.rb
Instance Method Summary collapse
- #add_changed_table(table_name) ⇒ Object
- #changed_table?(table_name) ⇒ Boolean
- #fully_joinable? ⇒ Boolean
- #initialize ⇒ Object
- #within_new_transaction ⇒ Object
Instance Method Details
#add_changed_table(table_name) ⇒ Object
70 71 72 |
# File 'lib/ar_cache/active_record/connection_adapters/abstract/transaction.rb', line 70 def add_changed_table(table_name) @changed_tables[table_name] = true if fully_joinable? end |
#changed_table?(table_name) ⇒ Boolean
74 75 76 |
# File 'lib/ar_cache/active_record/connection_adapters/abstract/transaction.rb', line 74 def changed_table?(table_name) @changed_tables.key?(table_name) end |
#fully_joinable? ⇒ Boolean
78 79 80 |
# File 'lib/ar_cache/active_record/connection_adapters/abstract/transaction.rb', line 78 def fully_joinable? @stack.all?(&:joinable?) end |
#initialize ⇒ Object
65 66 67 68 |
# File 'lib/ar_cache/active_record/connection_adapters/abstract/transaction.rb', line 65 def initialize(...) super @changed_tables = {} end |
#within_new_transaction ⇒ Object
82 83 84 85 86 |
# File 'lib/ar_cache/active_record/connection_adapters/abstract/transaction.rb', line 82 def within_new_transaction(...) super ensure @changed_tables = {} if @stack.count(&:joinable?).zero? end |