otwarchive-symphonyarchive/app/models/collection_preference.rb

16 lines
395 B
Ruby
Raw Permalink Normal View History

2026-03-11 22:22:11 +00:00
class CollectionPreference < ApplicationRecord
belongs_to :collection
after_update :after_update
def after_update
if self.collection.valid? && self.valid?
if self.saved_change_to_unrevealed? && !self.unrevealed?
self.collection.reveal!
end
if self.saved_change_to_anonymous? && !self.anonymous?
collection.reveal_authors!
end
end
end
end