diff --git a/app/models/repository_git_extra.rb b/app/models/repository_git_extra.rb index fe6e3a37c37..bb1cae82b7e 100644 --- a/app/models/repository_git_extra.rb +++ b/app/models/repository_git_extra.rb @@ -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'], @@ -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 diff --git a/app/models/repository_post_receive_url.rb b/app/models/repository_post_receive_url.rb index 8bfb858dc8e..5daad69b9ca 100644 --- a/app/models/repository_post_receive_url.rb +++ b/app/models/repository_post_receive_url.rb @@ -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 } diff --git a/app/models/repository_protected_branche.rb b/app/models/repository_protected_branche.rb index f95911266e8..ea0e4759440 100644 --- a/app/models/repository_protected_branche.rb +++ b/app/models/repository_protected_branche.rb @@ -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+' diff --git a/db/migrate/20150823030100_migrate_protected_branches_users.rb b/db/migrate/20150823030100_migrate_protected_branches_users.rb index 9c1b60c54a6..1315ce46d01 100644 --- a/db/migrate/20150823030100_migrate_protected_branches_users.rb +++ b/db/migrate/20150823030100_migrate_protected_branches_users.rb @@ -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]