X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/754a0a9cb5c49114181fd1d1181eea0d757dbac4..33799121b8a1ea5fdb1508ceda3fa99736db923f:/app/models/user_block.rb diff --git a/app/models/user_block.rb b/app/models/user_block.rb index 9dd8d3138..f25bd47b8 100644 --- a/app/models/user_block.rb +++ b/app/models/user_block.rb @@ -3,12 +3,12 @@ # Table name: user_blocks # # id :integer not null, primary key -# user_id :bigint(8) not null -# creator_id :bigint(8) not null +# user_id :bigint not null +# creator_id :bigint not null # reason :text not null # ends_at :datetime not null # needs_view :boolean default(FALSE), not null -# revoker_id :bigint(8) +# revoker_id :bigint # created_at :datetime # updated_at :datetime # reason_format :enum default("markdown"), not null @@ -28,7 +28,7 @@ class UserBlock < ApplicationRecord validate :moderator_permissions - validates :reason, :characters => true + validates :reason, :characters => true, :length => { :maximum => 10000 } validates :deactivates_at, :comparison => { :greater_than_or_equal_to => :ends_at }, :unless => -> { needs_view } validates :deactivates_at, :absence => true, :if => -> { needs_view }