mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 12:43:06 +08:00
Skip initialization of sharable models if DB is not connected
This commit is contained in:
parent
34c8da949f
commit
57444dca65
1 changed files with 6 additions and 0 deletions
|
@ -46,6 +46,12 @@ module Shareable
|
|||
).where.not(team: teams))
|
||||
.distinct
|
||||
}
|
||||
rescue ActiveRecord::NoDatabaseError,
|
||||
ActiveRecord::ConnectionNotEstablished,
|
||||
ActiveRecord::StatementInvalid,
|
||||
PG::ConnectionBad
|
||||
|
||||
Rails.logger.info('Not connected to database, skipping sharable model initialization.')
|
||||
end
|
||||
|
||||
def shareable_write?
|
||||
|
|
Loading…
Reference in a new issue