Skip to content

Commit 17c27a9

Browse files
committed
Fix rails 7 and redmine 6.0.0 compatibility
1 parent dc13552 commit 17c27a9

4 files changed

+5
-4
lines changed

Diff for: app/models/repository_git_extra.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
class RepositoryGitExtra < ActiveRecord::Base
44
include Redmine::SafeAttributes
55

6+
include Redmine::I18n
67
SMART_HTTP_OPTIONS = [[l(:label_disabled), '0'],
78
[l(:label_http_only), '3'],
89
[l(:label_https_only), '1'],
@@ -33,7 +34,7 @@ class RepositoryGitExtra < ActiveRecord::Base
3334
validate :validate_urls_order
3435

3536
## Serializations
36-
serialize :urls_order, Array
37+
serialize :urls_order, type: Array
3738

3839
## Callbacks
3940
before_save :check_urls_order_consistency

Diff for: app/models/repository_post_receive_url.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RepositoryPostReceiveUrl < ActiveRecord::Base
2222
validates :mode, presence: true, inclusion: { in: %i[github get post] }
2323

2424
## Serializations
25-
serialize :triggers, Array
25+
serialize :triggers, type: Array
2626

2727
## Scopes
2828
scope :active, -> { where active: true }

Diff for: app/models/repository_protected_branche.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class RepositoryProtectedBranche < ActiveRecord::Base
3+
class RepositoryProtectedBranche < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base)
44
include Redmine::SafeAttributes
55
VALID_PERMS = ['RW+', 'RW', 'R', '-'].freeze
66
DEFAULT_PERM = 'RW+'

Diff for: db/migrate/20150823030100_migrate_protected_branches_users.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class RepositoryProtectedBrancheWrapped < RepositoryProtectedBranche
4-
serialize :user_list, Array
4+
serialize :user_list, type: Array
55
end
66

77
class MigrateProtectedBranchesUsers < ActiveRecord::Migration[4.2]

0 commit comments

Comments
 (0)