Use ApplicationRecord instead of ActiveRecord::Base (#38975).

Patch by Minoru Maeda (@maeda-m).

git-svn-id: https://svn.redmine.org/redmine/trunk@22619 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-01-23 11:52:38 +00:00
parent 28061fbcdb
commit 13aeb797cf
63 changed files with 118 additions and 86 deletions

View File

@@ -18,4 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative 'lib/acts_as_activity_provider'
ActiveRecord::Base.send(:include, Redmine::Acts::ActivityProvider)
Rails.application.reloader.to_prepare do
ApplicationRecord.send(:include, Redmine::Acts::ActivityProvider)
end

View File

@@ -18,4 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative 'lib/acts_as_attachable'
ActiveRecord::Base.send(:include, Redmine::Acts::Attachable)
Rails.application.reloader.to_prepare do
ApplicationRecord.send(:include, Redmine::Acts::Attachable)
end

View File

@@ -18,4 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative 'lib/acts_as_customizable'
ActiveRecord::Base.send(:include, Redmine::Acts::Customizable)
Rails.application.reloader.to_prepare do
ApplicationRecord.send(:include, Redmine::Acts::Customizable)
end

View File

@@ -18,4 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative 'lib/acts_as_event'
ActiveRecord::Base.send(:include, Redmine::Acts::Event)
Rails.application.reloader.to_prepare do
ApplicationRecord.send(:include, Redmine::Acts::Event)
end

View File

@@ -18,4 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative 'lib/acts_as_searchable'
ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
Rails.application.reloader.to_prepare do
ApplicationRecord.send(:include, Redmine::Acts::Searchable)
end

View File

@@ -4,7 +4,7 @@ acts_as_tree
Specify this +acts_as+ extension if you want to model a tree structure by providing a parent association and a children
association. This requires that you have a foreign key column, which by default is called +parent_id+.
class Category < ActiveRecord::Base
class Category < ApplicationRecord
acts_as_tree :order => "name"
end

View File

@@ -1,4 +1,6 @@
# frozen_string_literal: true
require_relative 'lib/active_record/acts/tree'
ActiveRecord::Base.send :include, ActiveRecord::Acts::Tree
Rails.application.reloader.to_prepare do
ApplicationRecord.send :include, ActiveRecord::Acts::Tree
end

View File

@@ -10,7 +10,7 @@ module ActiveRecord
# Specify this +acts_as+ extension if you want to model a tree structure by providing a parent association and a children
# association. This requires that you have a foreign key column, which by default is called +parent_id+.
#
# class Category < ActiveRecord::Base
# class Category < ApplicationRecord
# acts_as_tree :order => "name"
# end
#

View File

@@ -42,7 +42,7 @@ def teardown_db
end
end
class Mixin < ActiveRecord::Base
class Mixin < ApplicationRecord
end
class TreeMixin < Mixin

View File

@@ -19,4 +19,6 @@
# Include hook code here
require_relative 'lib/acts_as_watchable'
ActiveRecord::Base.send(:include, Redmine::Acts::Watchable)
Rails.application.reloader.to_prepare do
ApplicationRecord.send(:include, Redmine::Acts::Watchable)
end

View File

@@ -1,4 +1,6 @@
# frozen_string_literal: true
require_relative 'lib/gravatar'
ActionView::Base.send :include, GravatarHelper::PublicMethods
Rails.application.reloader.to_prepare do
ApplicationRecord.send :include, GravatarHelper::PublicMethods
end