Added some models
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

User
Item
Department
Categorie
AssignmentLog
Room
This commit is contained in:
2026-05-21 15:36:23 +02:00
parent 7b02520b6c
commit b7f0c35378
27 changed files with 387 additions and 2 deletions

11
app/models/room.rb Normal file
View File

@@ -0,0 +1,11 @@
class Room < ApplicationRecord
has_many :items, dependent: :nullify
has_many :assignment_logs, dependent: :destroy
validates :name, presence: true, uniqueness: true
# Für das Raum-Auswahlfeld im Formular
def name_with_building
building.present? ? "#{name} (Gebäude #{building})" : name
end
end