Skip to content

Commit

Permalink
Merge pull request #888 from jrafanie/rails7_permitted_classes
Browse files Browse the repository at this point in the history
Use Rails 7 way to set yaml permitted classes
  • Loading branch information
agrare committed Aug 6, 2024
2 parents 639a715 + 0a0ab2c commit b98c09d
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
@volume = FactoryBot.create(:cloud_volume_openstack)

# We're storing objects in the instance_type, so we must permit loading this class
if ActiveRecord.respond_to?(:yaml_column_permitted_classes)
ActiveRecord.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes | [@flavor.class]
else
ActiveRecord::Base.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes | [@flavor.class]
end
ActiveRecord.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes | [@flavor.class]

@task = FactoryBot.create(:miq_provision_openstack,
:source => @template,
Expand Down

0 comments on commit b98c09d

Please sign in to comment.