drapergem / draper

Decorators/View-Models for Rails Applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mongo error -> Uninitialized constant ActiveRecord Did you mean? ActiveModel

vhazbun opened this issue · comments

Setup

We do not use ActiveRecord at all.


About the error

The error occurs for some MongoDB documents.


Stack trace

/gems/draper-4.0.1/lib/draper/query_methods/load_strategy.rb:10 in allowed?
/gems/draper-4.0.1/lib/draper/query_methods.rb:7 in method_missing
app/views/manage/room_offers/show.html.erb:2

Possible solution on our end?

The most evident solution will be to implement this setup https://github.com/drapergem/draper#decorated-query-methods

However, I still do not understand why this occurs for some mongo documents, and not for all of them. Any ideas? Thanks.

Seems like we were decorating a nil object. Please disregard.