mirror of
https://github.com/redmine/redmine.git
synced 2026-07-13 16:43:05 +02:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
#
|
||||
|
||||
@@ -42,7 +42,7 @@ def teardown_db
|
||||
end
|
||||
end
|
||||
|
||||
class Mixin < ActiveRecord::Base
|
||||
class Mixin < ApplicationRecord
|
||||
end
|
||||
|
||||
class TreeMixin < Mixin
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user