0

I have one namespace model like this :

class Message::Notification < Message
end

And I define one entity like this:

class Message::Notification < Grape::Entity
   expose :id
end

There is a error when present the model:

    present @notification, with: Entities::Message::Notification

Error:

app/models/message/notification.rb:1:in `': superclass mismatch for class Notification (TypeError)

why
  • 23,923
  • 29
  • 97
  • 142

1 Answers1

1

You are redefining the same class with a different superclass. It looks to me like your second definition should be in a module Entities.

Andy Triggs
  • 1,286
  • 12
  • 17