forked from zammad/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow up - ca56de3 - Maintenance: Updated to Rails 6.0.4 and the new…
… Zeitwerk autoloader: Fixed deprecation of autoloading in initializers causing namespace lookup errors.
- Loading branch information
1 parent
3d946cf
commit 887b779
Showing
17 changed files
with
194 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/ | ||
|
||
# Rails' constant auto-loading resolves to 'rails/initializable' instead | ||
require_dependency 'zammad/application/initializer/db_preflight_check' | ||
require 'zammad/application/initializer/db_preflight_check' | ||
|
||
Zammad::Application::Initializer::DbPreflightCheck.perform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/ | ||
|
||
return if !ActiveRecord::Base.connected? | ||
Rails.application.reloader.to_prepare do | ||
|
||
# sync logo to fs / only if settings already exists | ||
return if ActiveRecord::Base.connection.tables.exclude?('settings') | ||
return if Setting.column_names.exclude?('state_current') | ||
next if !ActiveRecord::Base.connected? | ||
|
||
StaticAssets.sync | ||
# sync logo to fs / only if settings already exists | ||
next if ActiveRecord::Base.connection.tables.exclude?('settings') | ||
next if Setting.column_names.exclude?('state_current') | ||
|
||
StaticAssets.sync | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/ | ||
|
||
# Rails' constant auto-loading resolves to 'rails/initializable' instead | ||
require_dependency 'zammad/application/initializer/session_store' | ||
require 'zammad/application/initializer/session_store' | ||
|
||
Zammad::Application::Initializer::SessionStore.perform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/ | ||
|
||
require 'action_dispatch/middleware/cookies' | ||
|
||
module ActionDispatch | ||
class Cookies | ||
class CookieJar | ||
|
||
alias original_write_cookie? write_cookie? | ||
|
||
# https://github.com/rails/rails/blob/v6.0.4/actionpack/lib/action_dispatch/middleware/cookies.rb#L447-L449 | ||
def write_cookie?(cookie) | ||
original_write_cookie?(cookie.merge(secure: ::Session.secure_flag?)) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/ | ||
|
||
require 'rack/session/abstract/id' | ||
|
||
module Rack | ||
module Session | ||
module Abstract | ||
class Persisted | ||
|
||
alias original_security_matches? security_matches? | ||
|
||
# https://github.com/rack/rack/blob/2.2.3/lib/rack/session/abstract/id.rb#L363-L366 | ||
def security_matches?(request, options) | ||
options[:secure] = ::Session.secure_flag? | ||
original_security_matches?(request, options) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/ | ||
|
||
require 'rack/utils' | ||
|
||
module Rack | ||
module Utils | ||
|
||
module_function | ||
|
||
singleton_class.alias_method :original_add_cookie_to_header, :add_cookie_to_header | ||
|
||
# https://github.com/rack/rack/blob/2.2.3/lib/rack/session/utils.rb#L223-L262 | ||
def add_cookie_to_header(header, key, value) | ||
|
||
if value.is_a?(Hash) | ||
value[:secure] = ::Session.secure_flag? | ||
end | ||
|
||
original_add_cookie_to_header(header, key, value) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
spec/lib/zammad/application/initializer/session_store_spec.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.