Skip to content

Commit e6ed78b

Browse files
bhaibelgeeksam
authored andcommitted
add warning for folks using the latest Rails security patches
1 parent bae1789 commit e6ed78b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/lab_tech/engine.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,21 @@ module LabTech
22
class Engine < ::Rails::Engine
33
isolate_namespace LabTech
44
config.generators.api_only = true
5+
6+
config.after_initialize do
7+
required_serializable_classes = [
8+
ActiveSupport::Duration,
9+
ActiveSupport::TimeWithZone,
10+
ActiveSupport::TimeZone,
11+
Time,
12+
]
13+
14+
missing_classes = required_serializable_classes - Rails.configuration.active_record.yaml_column_permitted_classes
15+
16+
if missing_classes.any?
17+
puts "Please add #{missing_classes.join(', ')} to your Rails.configuration.active_record.yaml_column_permitted_classes.".red
18+
puts "LabTech will break your application horribly unless you do.".red
19+
end
20+
end
521
end
622
end

0 commit comments

Comments
 (0)