Skip to content

Commit c127159

Browse files
committed
Redmine 6 compatibility: update models to inherit from ApplicationRecord
1 parent f32c3fc commit c127159

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/models/core_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CoreField < ActiveRecord::Base
1+
class CoreField < ApplicationRecord
22
include Redmine::SafeAttributes
33

44
has_and_belongs_to_many :roles, :join_table => "core_fields_roles", :foreign_key => "core_field_id"

init.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@
1818
'display_custom_fields_first' => 'true' },
1919
:partial => 'settings/redmine_plugin_customize_core_fields'
2020
end
21+
22+
# Support for Redmine 5
23+
if Redmine::VERSION::MAJOR < 6
24+
class ApplicationRecord < ActiveRecord::Base
25+
self.abstract_class = true
26+
end
27+
end

0 commit comments

Comments
 (0)