A platform for community discussion. Free, open, simple.
FIX: ActiveModel::Types :array load error in production (#22377)
Martin Brennan821cf201f55f
diff --git a/plugins/chat/lib/chat/types/array.rb b/plugins/chat/lib/chat/types/array.rbindex 2c4672ff1b5..a8491a868b1 100644--- a/plugins/chat/lib/chat/types/array.rb+++ b/plugins/chat/lib/chat/types/array.rb@@ -18,3 +18,5 @@ module Chatendendend++ActiveSupport.on_load(:active_record) { ActiveModel::Type.register(:array, Chat::Types::Array) }diff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rbindex 2f0e17d373e..0ef9df5832f 100644--- a/plugins/chat/plugin.rb+++ b/plugins/chat/plugin.rb@@ -32,6 +32,7 @@ module ::Chatendrequire_relative "lib/chat/engine"+require_relative "lib/chat/types/array"after_initialize doregister_seedfu_fixtures(Rails.root.join("plugins", "chat", "db", "fixtures"))@@ -496,8 +497,6 @@ after_initialize do)register_bookmarkable(Chat::MessageBookmarkable)-- ActiveModel::Type.register(:array, Chat::Types::Array)endif Rails.env == "test"