I am trying to create a reactive chat application with Rails 7 using MongoDB.
I have three models that I'm working with: 1. Topic 2. TopicMessage 3. User
For the MongoDB setup, it is required to use Mongoid and the models cannot inherit from 'ApplicationRecord'
An error occurs when trying to use broadcasts_to due to not inheriting from ApplicatioRecord
Is there a way around this?
I get the following error from attempting this code
class Topic
include Mongoid::Document
include Mongoid::Timestamps
field :parent_thread, type: Integer
field :name, type: String
field :description, type: String
field :url_image, type: String
field :community_id, type: String
broadcasts_to ->(topic){:topics_list}
end
undefined method `broadcasts_to' for Topic:Class