Skip to content

Support multiple databases - #26

Draft
sharshenov wants to merge 1 commit into
rrn:masterfrom
amplemarket:multi-dbs
Draft

Support multiple databases#26
sharshenov wants to merge 1 commit into
rrn:masterfrom
amplemarket:multi-dbs

Conversation

@sharshenov

@sharshenov sharshenov commented Jul 21, 2025

Copy link
Copy Markdown

Rails natively supports multi-database setups starting with version 6.0.

class AnimalsModel < ApplicationRecord
  self.abstract_class = true

  connects_to database: { writing: :primary, reading: :primary_replica }
end

This PR updates acts_as_dag to select the correct database when defining link and descendant models by inheriting from the nearest abstract class. This change allows it to support multi-database setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant