Skip to content

Commit

Permalink
Fix validation for host_resources nil
Browse files Browse the repository at this point in the history
Ignore validation in case host_resources are not present.
  • Loading branch information
bastian-src committed Dec 4, 2024
1 parent b19ded9 commit fd15987
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module HostManagedExtensions

# A host shall always have a .host_resources attribute
before_validation :build_host_resources, unless: -> { host_resources.present? }
after_save :save_host_resources, if: -> { host_resources.changed? }
after_save :save_host_resources, if: -> { host_resources&.changed? }
end

def verify_resource_quota
Expand Down

0 comments on commit fd15987

Please sign in to comment.