fixes #2192
This commit is contained in:
@@ -124,7 +124,7 @@ class ForumTopic < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
hash[id.to_s] = updated_at.to_i.to_s
|
hash[id.to_s] = updated_at.to_i.to_s
|
||||||
result = hash.to_a.flatten.join(" ")
|
result = hash.to_a.flatten.join(" ")
|
||||||
while result.size > 3000
|
while result.size > 500
|
||||||
ids = result.scan(/\S+/)
|
ids = result.scan(/\S+/)
|
||||||
result = ids[(ids.size / 2)..-1].join(" ")
|
result = ids[(ids.size / 2)..-1].join(" ")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class ForumTopicTest < ActiveSupport::TestCase
|
|||||||
should "prune the string if it gets too long" do
|
should "prune the string if it gets too long" do
|
||||||
array = (1..1_000).to_a.map(&:to_s).in_groups_of(2)
|
array = (1..1_000).to_a.map(&:to_s).in_groups_of(2)
|
||||||
result = @topic.mark_as_read(array)
|
result = @topic.mark_as_read(array)
|
||||||
assert_operator result.size, :<, 3000
|
assert_operator result.size, :<, 500
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user