Sha256: feb8c35c25107cf495f7346a8bc51c32ee9a934416fbd96d36f2699209532302
Contents?: true
Size: 458 Bytes
Versions: 5
Compression:
Stored size: 458 Bytes
Contents
module Elabs class ProjectsNote < ApplicationRecord self.table_name = 'projects_notes' belongs_to :project belongs_to :note after_create :increment_counter_cache after_destroy :decrement_counter_cache private def increment_counter_cache project.increment! :notes_count if note.publicly_visible? end def decrement_counter_cache project.decrement! :notes_count if note.publicly_visible? end end end
Version data entries
5 entries across 5 versions & 1 rubygems