Sha256: d5045373f9b5f1d615c95312b69b55802f7d8ca236df09b25e93c4e6e8e47108

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

# encoding: utf-8

class PageComment < ActiveRecord::Base
  include PagesCore::Sweepable

  belongs_to :page, counter_cache: :comments_count
  attr_accessor :invalid_captcha

  def valid_captcha?
    invalid_captcha ? false : true
  end

  after_create do |page_comment|
    if page_comment.page && page_comment.valid?
      page_comment.page.update(last_comment_at: page_comment.created_at)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.5.1 app/models/page_comment.rb