Skip to content

Remove ApplicationRecord base model#23

Merged
blocknotes merged 1 commit intomasterfrom
remove-application-record
Mar 4, 2022
Merged

Remove ApplicationRecord base model#23
blocknotes merged 1 commit intomasterfrom
remove-application-record

Conversation

@blocknotes
Copy link
Copy Markdown
Owner

No description provided.

@blocknotes blocknotes self-assigned this Mar 4, 2022
@blocknotes blocknotes added this to the 1.1 milestone Mar 4, 2022
@blocknotes blocknotes marked this pull request as ready for review March 4, 2022 08:31
@blocknotes blocknotes merged commit ad92932 into master Mar 4, 2022
@blocknotes blocknotes deleted the remove-application-record branch March 4, 2022 08:31
@codeodor
Copy link
Copy Markdown

I am curious as to why this was removed, as it would cause this not to work if using Rails' multi DB approach -- it would potentially go into a different database rather than the one we are connected to in ApplicationRecord at the time.

I am looking into using this project and just noticed this -- thought I might reach out to let you know.

Thanks for what looks to be good work!

@blocknotes
Copy link
Copy Markdown
Owner Author

I am curious as to why this was removed, as it would cause this not to work if using Rails' multi DB approach -- it would potentially go into a different database rather than the one we are connected to in ApplicationRecord at the time.

Thank you for your feedback!
I simply didn't like the idea to have an extra ApplicationRecord in the gem.
But the case that you propose is reasonable, so I can restore it.

And to customise the connection options you would expect to reopen the class?
Something like:

ActiveStorageDB::ApplicationRecord.class_eval do
  connects_to database: { writing: :main, reading: :read_only }
end

I'm wondering if there are better options for it.

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.

2 participants