summaryrefslogtreecommitdiff
path: root/app/models/page.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-09 15:45:56 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-09 15:45:56 +0200
commit9d32458491d79f8e06a706375030c78282f4427b (patch)
tree5eee208b844df39dfd66d9f0d1618fb5fa437fdb /app/models/page.rb
parented3905b5409190c1e11c2c49c2163ac967c6d8b9 (diff)
Report every editorial attribute in the revision diff
diff_against gained external_url, published_at and user. The view renders each metadata section only when that attribute changed, and says so once when none did. Metadata now precedes the locale pointer, which speaks only of translations: above the metadata it read as "nothing changed" on a revision that had moved the page.
Diffstat (limited to 'app/models/page.rb')
-rw-r--r--app/models/page.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/page.rb b/app/models/page.rb
index 3240057f..c2dc227b 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -277,6 +277,12 @@ class Page < ApplicationRecord
277 277
278 text_diffs.merge( 278 text_diffs.merge(
279 address: address_diff_against(other), 279 address: address_diff_against(other),
280 external_url: { from: other.external_url, to: external_url,
281 changed: external_url.presence != other.external_url.presence },
282 published_at: { from: other.published_at, to: published_at,
283 changed: published_at != other.published_at },
284 user: { from: other.user, to: user,
285 changed: user_id != other.user_id },
280 tags: { added: tag_list.to_a - other.tag_list.to_a, removed: other.tag_list.to_a - tag_list.to_a }, 286 tags: { added: tag_list.to_a - other.tag_list.to_a, removed: other.tag_list.to_a - tag_list.to_a },
281 template_name: { from: other.template_name, to: template_name, changed: template_name != other.template_name }, 287 template_name: { from: other.template_name, to: template_name, changed: template_name != other.template_name },
282 assets: { added: assets.to_a - other.assets.to_a, removed: other.assets.to_a - assets.to_a } 288 assets: { added: assets.to_a - other.assets.to_a, removed: other.assets.to_a - assets.to_a }