投票機能の関連レコードの集計にcounter_cultureを使用しているのですが、投票期限が締切の場合にカウントの集計を停止するにはどうすればいいでしょうか?
■投票記事 class Vote < ActiveRecord::Base has_many :entries has_many :votings accepts_nested_attributes_for :entries end ■投票項目(エントリー) class Entry < ActiveRecord::Base belongs_to :vote has_many :votings end ■投票 class Voting < ActiveRecord::Base belongs_to :vote belongs_to :entry counter_culture [:entry, :vote] counter_culture [:entry] end
Voteはtermという投票期限のカラムを持っており、これが現在の日付と比較して締切の場合にはカウントの集計を停止したいです。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。