Skip to content
Snippets Groups Projects
Unverified Commit 1ca23769 authored by Khemissi Amir's avatar Khemissi Amir Committed by GitHub
Browse files

GIT-3073: Fixed the session failing for rooms with one character in length (Fixes #3073). (#3098)

parent a064ed7e
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ class Room < ApplicationRecord
before_destroy :destroy_presentation
validates :name, presence: true
validates :name, length: { in: 2..256 }
belongs_to :owner, class_name: 'User', foreign_key: :user_id
has_many :shared_access, dependent: :destroy
......
......@@ -28,7 +28,7 @@
<span class="input-icon-addon">
<i class="fas fa-chalkboard-teacher"></i>
</span>
<%= f.text_field :name, id: "create-room-name", class: "form-control text-center", value: "", placeholder: t("modal.create_room.name_placeholder"), autocomplete: :off, required: true %>
<%= f.text_field :name, id: "create-room-name", class: "form-control text-center", value: "", placeholder: t("modal.create_room.name_placeholder"), autocomplete: :off, required: true , minlength: 2, maxlength: 256 %>
<div class="invalid-feedback text-left"><%= t("modal.create_room.not_blank") %></div>
</div>
......
......@@ -26,7 +26,7 @@ describe Room, type: :model do
end
context 'validations' do
it { should validate_presence_of(:name) }
it { should validate_length_of(:name).is_at_least(2).is_at_most(256) }
end
context 'associations' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment