fix attachment validation for o_auth and post entities

This commit is contained in:
riggraz
2025-02-05 13:47:01 +01:00
parent e4ddf0e5f3
commit cbd1ebebd1
2 changed files with 4 additions and 1 deletions

View File

@@ -19,6 +19,9 @@ class OAuth < ApplicationRecord
validates :profile_url, presence: true
validates :scope, presence: true
validates :json_user_email_path, presence: true
validates :logo,
content_type: Rails.application.accepted_image_types,
size: { less_than: 64.kilobytes }
friendly_id :generate_random_slug, use: :scoped, scope: :tenant_id

View File

@@ -28,7 +28,7 @@ class Post < ApplicationRecord
validates :title, presence: true, length: { in: 4..128 }
validates :attachments,
content_type: Rails.application.accepted_image_types,
size: { less_than: 256.kilobytes },
size: { less_than: 2048.kilobytes },
limit: { max: 5 }
paginates_per Rails.application.posts_per_page