PG::UndefinedTable: ERROR: relation “carrinho” does not exist

[亡魂溺海] 提交于 2019-12-12 04:03:47

问题


I'm using rails 4, ruby 2.3 and have a problem. How solve this error?

PG::UndefinedTable: ERROR: relation "carrinho" does not exist LINE 1: SELECT "carrinho".* FROM "carrinho" WHERE "carrinho"."id" I... ^ : SELECT "carrinho".* FROM "carrinho" WHERE "carrinho"."id" IS NULL LIMIT 1

My model is carrinho.rb My controller is carrinhos_controller.rb My views is carrinhos My migration is 20160204181641_create_carrinhos.rb

And in inflections have:

  inflect.plural "carrinhos", "carrinhos"
  inflect.plural "carrinho", "carrinhos"
  inflect.singular "carrinhos", "carrinho"
  inflect.singular "carrinho", "carrinho"
  inflect.irregular 'carrinho', 'carrinhos'

Make A week that I try to solve this problem. Please, help-me!!


回答1:


I solve this, I just chanced position of inflect.irregular "carrinho", "carrinhos" to the beginning, and worked! I didn't know that the order influences, but now I don't mistake more. I hope it helped all.



来源:https://stackoverflow.com/questions/35209518/pgundefinedtable-error-relation-carrinho-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!