I have two database in one app
- Postgres
- MongoDB
Except one model, all models are in Postgres
Model name Message is in MongoDB as following
message.rb- MongoDBclass Message include Mongoid::Document field :content, type: String field :user_id, type: Integer enduser.rb- Postgresclass User < ApplicationRecord end
Now I want to associate user model with message model, to perform eagerloading.
If I write belongs_to :user, and then perform Message.last.user then following error will raise
NoMethodError (undefined method `_association' for []:Array)
Is there anyway to fix this issue?