diff --git a/app/models/article.rb b/app/models/article.rb index 0d968a1e1..441fae5c5 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -31,7 +31,7 @@ class Article < ApplicationRecord validate :validate_tag validate :validate_video validates :video_state, inclusion: { in: %w(PROGRESSING COMPLETED) }, allow_nil: true - validates :cached_tag_list, length: { maximum: 64 } + validates :cached_tag_list, length: { maximum: 86 } validates :main_image, url: { allow_blank: true, schemes: ["https", "http"] } validates :main_image_background_hex_color, format: /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/ validates :video, url: { allow_blank: true, schemes: ["https", "http"] } @@ -414,7 +414,7 @@ class Article < ApplicationRecord return errors.add(:tag_list, "exceed the maximum of 4 tags") if tag_list.length > 4 tag_list.each do |tag| if tag.length > 20 - errors.add(:tag, "\"#{tag}\" is too long (maximum is 16 characters)") + errors.add(:tag, "\"#{tag}\" is too long (maximum is 20 characters)") end end end diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb index f671fb60e..8fe284209 100644 --- a/spec/models/article_spec.rb +++ b/spec/models/article_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Article, type: :model do it { is_expected.to validate_uniqueness_of(:feed_source_url).allow_blank } it { is_expected.to validate_presence_of(:title) } it { is_expected.to validate_length_of(:title).is_at_most(128) } - it { is_expected.to validate_length_of(:cached_tag_list).is_at_most(64) } + it { is_expected.to validate_length_of(:cached_tag_list).is_at_most(86) } it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:organization) } it { is_expected.to belong_to(:collection) }