Fixed typo

This commit is contained in:
2024-10-02 13:51:15 +02:00
parent 23749c80b8
commit 337ff9b9d9
24 changed files with 79 additions and 79 deletions

View File

@@ -1,12 +1,12 @@
class CreateJobs < ActiveRecord::Migration[7.1]
def change
create_table :jobs do |t|
t.references :costumer, null: true
t.references :customer, null: true
t.references :creator, null: true
t.references :cashier, null: true
t.references :operator, null: true
t.string :costumer_firstname
t.string :costumer_lastname
t.string :customer_firstname
t.string :customer_lastname
t.string :operator_firstname
t.string :operator_lastname
t.string :cashier_firstname

View File

@@ -10,14 +10,14 @@ class CreateUsers < ActiveRecord::Migration[7.2]
t.boolean :verified, null: false, default: false
t.integer :costumer_jobs_count, default: 0
t.integer :customer_jobs_count, default: 0
t.integer :operator_jobs_count, default: 0
t.integer :created_jobs_count, default: 0
t.integer :cashed_jobs_count, default: 0
t.timestamps
end
add_foreign_key :jobs, :users, column: :costumer_id
add_foreign_key :jobs, :users, column: :customer_id
add_foreign_key :jobs, :users, column: :operator_id
add_foreign_key :jobs, :users, column: :creator_id
add_foreign_key :jobs, :users, column: :cashier_id

12
db/schema.rb generated
View File

@@ -40,12 +40,12 @@ ActiveRecord::Schema[7.2].define(version: 2024_08_26_144016) do
end
create_table "jobs", force: :cascade do |t|
t.integer "costumer_id"
t.integer "customer_id"
t.integer "creator_id"
t.integer "cashier_id"
t.integer "operator_id"
t.string "costumer_firstname"
t.string "costumer_lastname"
t.string "customer_firstname"
t.string "customer_lastname"
t.string "operator_firstname"
t.string "operator_lastname"
t.string "cashier_firstname"
@@ -68,8 +68,8 @@ ActiveRecord::Schema[7.2].define(version: 2024_08_26_144016) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["cashier_id"], name: "index_jobs_on_cashier_id"
t.index ["costumer_id"], name: "index_jobs_on_costumer_id"
t.index ["creator_id"], name: "index_jobs_on_creator_id"
t.index ["customer_id"], name: "index_jobs_on_customer_id"
t.index ["operator_id"], name: "index_jobs_on_operator_id"
t.index ["status"], name: "index_jobs_on_status"
end
@@ -90,7 +90,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_08_26_144016) do
t.string "lastname"
t.string "role", default: "user"
t.boolean "verified", default: false, null: false
t.integer "costumer_jobs_count", default: 0
t.integer "customer_jobs_count", default: 0
t.integer "operator_jobs_count", default: 0
t.integer "created_jobs_count", default: 0
t.integer "cashed_jobs_count", default: 0
@@ -103,8 +103,8 @@ ActiveRecord::Schema[7.2].define(version: 2024_08_26_144016) do
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "jobs", "users", column: "cashier_id"
add_foreign_key "jobs", "users", column: "costumer_id"
add_foreign_key "jobs", "users", column: "creator_id"
add_foreign_key "jobs", "users", column: "customer_id"
add_foreign_key "jobs", "users", column: "operator_id"
add_foreign_key "sessions", "users"
end

View File

@@ -78,7 +78,7 @@ end
job = Job.new(status:, privacy_policy: true, created_at: created_at)
job.pdf = File.open(Rails.root.join('db/pdfs/', pdf))
student = students[rand(0..9)]
job.costumer = student
job.customer = student
job.creator = student
operator = operators[rand(0...1)]
job.operator = operator if status != :open
@@ -112,7 +112,7 @@ end
job = Job.new(status:, privacy_policy: true, created_at: created_at)
job.pdf = File.open(Rails.root.join('db/pdfs/', pdf))
student = students[rand(0...9)]
job.costumer = student
job.customer = student
job.creator = student
operator = operators[rand(0...1)]
job.operator = operator if status == :paid
@@ -137,7 +137,7 @@ end
job = Job.new(status:, privacy_policy: true)
job.pdf = File.open(Rails.root.join('db/pdfs/', pdf))
student = students[rand(0...4)]
job.costumer = student
job.customer = student
job.creator = student
operator = operators[rand(0...1)]
job.operator = operator if status != :open
@@ -154,9 +154,9 @@ end
job = Job.new(privacy_policy: true)
job.pdf = File.open(Rails.root.join('db/pdfs/', pdf))
student = students[rand(0...9)]
job.costumer = [ student, student, false ].sample
job.costumer_firstname = student.firstname
job.costumer_lastname = student.lastname
job.customer = [ student, student, false ].sample
job.customer_firstname = student.firstname
job.customer_lastname = student.lastname
job.creator = operators[rand(0...1)]
job.created_by_operator = true
job.inspect