You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't require role when passing shard to connected_to
Originally we required `role` when switching `shard`'s because I felt it
made it less confusing. However now that we're exploring some more
multi-tenancy work I agree we need to move this condition. Otherwise if
you're using one middleware to switch roles and another to switch
shards, you may be forced to pass the role around in places you're only
concerned with shard. This also simplifies the call for applications
that don't use roles and only have writer shards.
Copy file name to clipboardExpand all lines: activerecord/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
* Don't require `role` when passing `shard` to `connected_to`.
2
+
3
+
`connected_to` can now be called with a `shard` only. Note that `role` is still inherited if `connected_to` calls are nested.
4
+
5
+
*Eileen M. Uchitelle*
6
+
1
7
* Add option to lazily load the schema cache on the connection.
2
8
3
9
Previously, the only way to load the schema cache in Active Record was through the Railtie on boot. This option provides the ability to load the schema cache on the connection after it's been established. Loading the cache lazily on the connection can be beneficial for Rails applications that use multiple databases because it will load the cache at the time the connection is established. Currently Railties doesn't have access to the connections before boot.
0 commit comments