Rubocop rules

This commit is contained in:
Nedim
2025-02-17 19:12:40 +01:00
parent ef01db0700
commit ee89170c32
42 changed files with 1043 additions and 267 deletions

View File

@@ -1,6 +1,6 @@
class RemoveTitleAndDescriptionFromReservations < ActiveRecord::Migration[7.1]
def change
remove_column :reservations, :title, :string
remove_column :reservations, :description, :text
# remove_column :reservations, :title, :string
# remove_column :reservations, :description, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddIndexToCustomers < ActiveRecord::Migration[7.1]
def change
add_index :customers, [:name, :company_id], unique: true
end
end

14
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_08_18_063444) do
ActiveRecord::Schema[7.1].define(version: 2025_02_17_185300) do
create_table "companies", force: :cascade do |t|
t.string "name"
t.string "id_number"
@@ -34,19 +34,14 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_18_063444) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "company_id"
end
create_table "places", force: :cascade do |t|
t.string "name"
t.integer "company_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["company_id"], name: "index_places_on_company_id"
t.index ["name", "company_id"], name: "index_customers_on_name_and_company_id", unique: true
end
create_table "reservations", force: :cascade do |t|
t.integer "company_id", null: false
t.integer "customer_id", null: false
t.string "title"
t.text "description"
t.datetime "start_time"
t.datetime "end_time"
t.datetime "created_at", null: false
@@ -65,7 +60,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_18_063444) do
t.index ["company_id"], name: "index_teams_on_company_id"
end
add_foreign_key "places", "companies"
add_foreign_key "reservations", "companies"
add_foreign_key "reservations", "customers"
add_foreign_key "reservations", "teams"