grape-entity icon indicating copy to clipboard operation
grape-entity copied to clipboard

model name is diffrent of table name an error

Open guoyoujin opened this issue 8 years ago • 1 comments

hi my project model name is TxhimsPatientInfo ,but my databse table name is patient_infos

class TxhimsPatientInfo < TxhimsModel
     self.table_name = "patient_infos"
end

entity name is TxhimsPatientInfoEntity

class TxhimsPatientInfoEntity < Grape::Entity
  expose :id, :patient_name
  expose :body_description
end

I m used the bottom code has a misstake error ArgumentError (A copy of V1::ExamineReportsAPI has been removed from the module tree but is still active!):

present :data, TxhimsPatientInfo.all, :with => TxhimsPatientInfoEntity

guoyoujin avatar Feb 23 '17 04:02 guoyoujin

Seems like you have outdated version of your app running in process. Try to restart the server.

giedriusr avatar Feb 24 '17 11:02 giedriusr