Skip to content

Commit

Permalink
nsbox: fix an error during db:migrate
Browse files Browse the repository at this point in the history
During the initial migration, the settings table has not been created
yet, so the following error is raised:

  ActiveRecord::StatementInvalid: Could not find table 'settings'
  • Loading branch information
xjia1 authored and Joshua1023 committed May 16, 2024
1 parent fad335f commit a7b5b8e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/redmine/preparation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ def self.prepare
:if => Proc.new {!User.current.logged? && Setting.self_registration?}
menu.push :my_account, {:controller => 'my', :action => 'account'},
:if => Proc.new {User.current.logged?}
menu.push :logout, '/OIDCRedirectURI?logout=https%3A%2F%2F' + ERB::Util.url_encode(Setting.host_name) + '%2F',
:if => Proc.new {User.current.logged?}
unless ARGV.include? 'db:migrate'
# Setting.host_name needs to query the database, so we need to avoid
# calling it during the (initial) migration.
menu.push :logout, '/OIDCRedirectURI?logout=https%3A%2F%2F' + ERB::Util.url_encode(Setting.host_name) + '%2F',
:if => Proc.new {User.current.logged?}
end
end

MenuManager.map :application_menu do |menu|
Expand Down

0 comments on commit a7b5b8e

Please sign in to comment.