Skip to content

Commit 02a744d

Browse files
committed
Fix context depending on connected?
For some reason I can't get our connected? to return true. It's unclear whether its a (monkey patching) bug in our app, but it shouldn't be necessary here anyways since we're only looking at statically defined configuration. This rescue may not be necessary, there's one test in Rails' suite that fails without it but it seems suspect.
1 parent 06b8267 commit 02a744d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

activerecord/lib/active_record/model_schema.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,8 @@ module ClassMethods
205205
# Returns the current schema context key from the connection configuration.
206206
# Defaults to "default" if no connection is available or no context is configured.
207207
def current_schema_context_key # :nodoc:
208-
return "default" unless connected?
209208
connection_db_config.schema_context_key
210-
rescue
209+
rescue ConnectionNotDefined
211210
"default"
212211
end
213212

0 commit comments

Comments
 (0)