Skip to content

Commit

Permalink
Fix rails 7 and redmine 6.0.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
HighwayStar committed Nov 15, 2024
1 parent dc13552 commit 17c27a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/models/repository_git_extra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class RepositoryGitExtra < ActiveRecord::Base
include Redmine::SafeAttributes

include Redmine::I18n
SMART_HTTP_OPTIONS = [[l(:label_disabled), '0'],
[l(:label_http_only), '3'],
[l(:label_https_only), '1'],
Expand Down Expand Up @@ -33,7 +34,7 @@ class RepositoryGitExtra < ActiveRecord::Base
validate :validate_urls_order

## Serializations
serialize :urls_order, Array
serialize :urls_order, type: Array

## Callbacks
before_save :check_urls_order_consistency
Expand Down
2 changes: 1 addition & 1 deletion app/models/repository_post_receive_url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RepositoryPostReceiveUrl < ActiveRecord::Base
validates :mode, presence: true, inclusion: { in: %i[github get post] }

## Serializations
serialize :triggers, Array
serialize :triggers, type: Array

## Scopes
scope :active, -> { where active: true }
Expand Down
2 changes: 1 addition & 1 deletion app/models/repository_protected_branche.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class RepositoryProtectedBranche < ActiveRecord::Base
class RepositoryProtectedBranche < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base)
include Redmine::SafeAttributes
VALID_PERMS = ['RW+', 'RW', 'R', '-'].freeze
DEFAULT_PERM = 'RW+'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class RepositoryProtectedBrancheWrapped < RepositoryProtectedBranche
serialize :user_list, Array
serialize :user_list, type: Array
end

class MigrateProtectedBranchesUsers < ActiveRecord::Migration[4.2]
Expand Down

0 comments on commit 17c27a9

Please sign in to comment.