eBooru/app/helpers/pool_versions_helper.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

18 lines
403 B
Ruby

# frozen_string_literal: true
module PoolVersionsHelper
def pool_version_posts_diff(pool_version)
changes = []
pool_version.added_post_ids.each do |post_id|
changes << tag.ins(link_to(post_id, post_path(post_id)))
end
pool_version.removed_post_ids.each do |post_id|
changes << tag.del(link_to(post_id, post_path(post_id)))
end
safe_join(changes, " ")
end
end