Added counter_cache for user jobs, replaced count with size to use cache.

This commit is contained in:
2024-09-17 23:36:45 +02:00
parent 70dd3a0ab8
commit bd58c9d0c6
9 changed files with 31 additions and 26 deletions

View File

@@ -10,6 +10,9 @@ class CreateUsers < ActiveRecord::Migration[7.2]
t.boolean :verified, null: false, default: false
t.integer :jobs_as_costumer_count, default: 0
t.integer :jobs_as_operator_count, default: 0
t.timestamps
end
add_foreign_key :jobs, :users, column: :operator_id