method

write_to_primary

Importance_0
v6.1.7.7 - Show latest stable - 0 notes - Class: Resolver
write_to_primary(&blk) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/middleware/database_selector/resolver.rb, line 68
          def write_to_primary(&blk)
            ActiveRecord::Base.connected_to(role: ActiveRecord::Base.writing_role, prevent_writes: false) do
              instrumenter.instrument("database_selector.active_record.wrote_to_primary") do
                yield
              ensure
                context.update_last_write_timestamp
              end
            end
          end
Register or log in to add new notes.