discourse/app/models/group_request.rb
Loïc Guitaut 4ea396e67c DEV: Bump the limits on group request text fields
Users submitting requests to join groups were not receiving errors when
the character limit for the request was exceeded. This also affects the
UX when admin-created group request templates are inserted into the
request.

This patch bumps the limits.

- https://meta.discourse.org/t/group-membership-requests-suddenly-limited-to-274-characters/265127
- https://github.com/discourse/discourse/pull/19993
2023-05-24 09:57:46 +02:00

29 lines
683 B
Ruby

# frozen_string_literal: true
class GroupRequest < ActiveRecord::Base
REASON_CHARACTER_LIMIT = 5000
belongs_to :group
belongs_to :user
validates :reason, length: { maximum: REASON_CHARACTER_LIMIT }
end
# == Schema Information
#
# Table name: group_requests
#
# id :bigint not null, primary key
# group_id :integer
# user_id :integer
# reason :text
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_group_requests_on_group_id (group_id)
# index_group_requests_on_group_id_and_user_id (group_id,user_id) UNIQUE
# index_group_requests_on_user_id (user_id)
#