Added counter_cache for user jobs, replaced count with size to use cache.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Job < ApplicationRecord
|
||||
belongs_to :operator, class_name: "User", optional: true
|
||||
belongs_to :costumer, class_name: "User", optional: true
|
||||
belongs_to :operator, class_name: "User", optional: true, counter_cache: :jobs_as_operator_count
|
||||
belongs_to :costumer, class_name: "User", optional: true, counter_cache: :jobs_as_costumer_count
|
||||
|
||||
has_one_attached :pdf, dependent: :purge
|
||||
|
||||
|
||||
Reference in New Issue
Block a user