Skip to content

Commit

Permalink
Use ActiveRecord.writing_role
Browse files Browse the repository at this point in the history
ActiveRecord::Base.writing_role is deprecated and will be removed
from Rails 7.1
  • Loading branch information
tvdeyen authored and sascha-karnatz committed Aug 2, 2023
1 parent c3f926f commit 124988f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/alchemy/picture/url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def uid
thumb.uid
else
uid = PictureThumb::Uid.call(signature, variant)
ActiveRecord::Base.connected_to(role: ActiveRecord::Base.writing_role) do
ActiveRecord::Base.connected_to(role: ActiveRecord.writing_role) do
PictureThumb::Create.call(variant, signature, uid)
end
uid
Expand Down
2 changes: 1 addition & 1 deletion spec/models/alchemy/picture/url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
end

it "connects to writing database" do
writing_role = ActiveRecord::Base.writing_role
writing_role = ActiveRecord.writing_role
expect(ActiveRecord::Base).to receive(:connected_to).with(role: writing_role)
subject
end
Expand Down

0 comments on commit 124988f

Please sign in to comment.