From 409d71ed471703be8c56f2639a3ecb0fa387e6a7 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 4 Aug 2026 07:07:05 +0200 Subject: Give node lists a flag column and a shared action bar --- app/models/node.rb | 4 ++++ app/models/user.rb | 18 ------------------ 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'app/models') diff --git a/app/models/node.rb b/app/models/node.rb index d6fe32ff..f8c29b48 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -648,6 +648,10 @@ class Node < ApplicationRecord ) end + def embargoed? + head&.published_at.present? && head.published_at > Time.zone.now + end + # Nodes are never destroyed recursively # Descendants must be removed or reparented individually first. # The Trash feature will be the ordinary path to deletion. diff --git a/app/models/user.rb b/app/models/user.rb index 786f8d14..95706f86 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -70,24 +70,6 @@ class User < ApplicationRecord roles.include?("admin") end - # Compatibility shims for the users form, which posts user[admin] as a - # checkbox. Goes away when that form learns about roles. - def admin - is_admin? - end - - def admin? - is_admin? - end - - def admin=(value) - if ActiveModel::Type::Boolean.new.cast(value) - self.roles = (roles | ["admin"]) - else - self.roles = (roles - ["admin"]) - end - end - def redaktion? roles.include?("redaktion") end -- cgit v1.3