简体   繁体   English

数据库和应用程序Ruby on Rails之间的数据不一致

[英]Inconsistent of data between database and application Ruby on Rails

I am new to the world Ruby on Rails, and I'm having a problem (appearing to be simple). 我是Ruby on Rails的新手,但是我遇到了一个问题(看起来很简单)。

Production in the database is deleted all records related to a person. 数据库中的生产将删除与一个人相关的所有记录。 To date, the database no records related to the name "John Smith". 迄今为止,该数据库尚无与名称“ John Smith”相关的记录。

In ruby on rails application, when I do a search of the deleted record, it returns only the name and date as shown below: 在ruby on rails应用程序中,当我搜索已删除的记录时,它仅返回名称和日期,如下所示:

搜索已删除的记录

This record was not to be displayed anywhere. 该记录不会在任何地方显示。

Are there any Ruby on Rails command to update the records that were manually deleted in the database? 是否有任何Ruby on Rails命令来更新数据库中手动删除的记录?

Here are a few considerations that are configured in the project: 以下是在项目中配置的一些注意事项:

This inconsistency could be cached in the production environment? 这种不一致可以在生产环境中缓存吗? In the case could not be changed permanently, for best performance. 在无法永久更改的情况下,以获得最佳性能。

config.action_controller.perform_caching = true

It could then be the application in memory? 那可能是内存中的应用程序?

config.eager_load = true

Can help me solve and understand this problem? 能帮我解决和理解这个问题吗?

Thanks. 谢谢。

You should check straight in Console what records are loaded and why is this recored loaded. 您应该直接在控制台中检查加载了哪些记录以及为什么加载了此记录。

If you think it's caching, which i doubt, just restart web-server. 如果您认为它在缓存,我怀疑,请重新启动Web服务器。 Most likely you still have object somewhere in Database and it's not fully delete. 很可能您在数据库中的某个地方仍然有对象,并且它没有被完全删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM