app/models/concerns/hydra/access_controls/permissions.rb in hydra-access-controls-10.1.0 vs app/models/concerns/hydra/access_controls/permissions.rb in hydra-access-controls-10.2.0
- old
+ new
@@ -5,10 +5,10 @@
include Hydra::AccessControls::Visibility
included do
belongs_to :access_control, predicate: ::ACL.accessControl, class_name: 'Hydra::AccessControl'
before_destroy do |obj|
- access_control.destroy
+ access_control.destroy unless access_control.nil?
end
after_save do
# Only force save if autosave woudn't be called normally
access_control.save! unless access_control.changed?
end