【发布时间】:2016-01-28 03:50:39
【问题描述】:
我在我的 Rails 应用程序中使用了可邀请的设计。邀请计数列(应该是已发送邀请的计数器缓存)保持为零。
initializers/devise.rb
# The column name used for counter_cache column. If this is nil,
# the #invited_by association is declared without counter_cache.
# Default: nil
config.invited_by_counter_cache = :invitations_count
以上是宝石的到达方式。我取消了启用计数器的最后一行的注释。
我已经阅读了设计邀请 Github 问题页面,搜索了 SO 和 Google,并尝试在我的应用程序的各个地方摆弄。宝石的其余部分工作正常并发送邀请但没有计数器。
关于如何解决的想法?谢谢!
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 devise devise-invitable