Files
danbooru/app/helpers/artist_versions_helper.rb
BrokenEagle 7b1efd1204 Rework artist versions index view
- Added a changes column explicitly listing all of the changes
-- This makes it more in line with the other version views now
- Does a symmetric difference on the array fields to detect changes
2020-02-08 22:57:29 +00:00

18 lines
551 B
Ruby

module ArtistVersionsHelper
def artist_version_other_names_diff(artist_version)
new_names = artist_version.other_names
old_names = artist_version.previous.try(:other_names)
latest_names = artist_version.artist.other_names
diff_list_html(new_names, old_names, latest_names)
end
def artist_version_urls_diff(artist_version)
new_urls = artist_version.urls
old_urls = artist_version.previous.try(:urls)
latest_urls = artist_version.artist.urls.map(&:to_s)
diff_list_html(new_urls, old_urls, latest_urls)
end
end