Skip to content

Commit

Permalink
Merge pull request #23133 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
Fryguy authored Aug 6, 2024
2 parents 562abe9 + 1ea54f6 commit 0383295
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/yaml_permitted_classes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ def self.permitted_classes

def self.initialize_app_yaml_permitted_classes
@initialize_app_yaml_permitted_classes ||= begin
if ActiveRecord.respond_to?(:yaml_column_permitted_classes)
ActiveRecord.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes
else
ActiveRecord::Base.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes
end
ActiveRecord.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes
true
end
end
Expand Down

0 comments on commit 0383295

Please sign in to comment.