Sha256: 68cf0dd1d06e335841dc14bfedb92337d0421d3f335249770020c508cb824153
Contents?: true
Size: 472 Bytes
Versions: 5
Compression:
Stored size: 472 Bytes
Contents
module Elabs class ProjectsUpload < ApplicationRecord self.table_name = 'projects_uploads' belongs_to :project belongs_to :upload after_create :increment_counter_cache after_destroy :decrement_counter_cache private def increment_counter_cache project.increment! :uploads_count if upload.publicly_visible? end def decrement_counter_cache project.decrement! :uploads_count if upload.publicly_visible? end end end
Version data entries
5 entries across 5 versions & 1 rubygems