Sha256: 6856a76cd9963ca39ea55aa72380af9cc3edeae4ee2afd844645352e842d695f
Contents?: true
Size: 378 Bytes
Versions: 24
Compression:
Stored size: 378 Bytes
Contents
module MyForum class Post < ActiveRecord::Base belongs_to :topic, :counter_cache => true belongs_to :user, :counter_cache => true after_create :update_topic_latest_post default_scope { where(is_deleted: false) } PER_PAGE = 15 private def update_topic_latest_post self.topic.update_attribute(:latest_post_id, self.id) end end end
Version data entries
24 entries across 24 versions & 1 rubygems