File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed
Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -375,10 +375,16 @@ which uses [Psych.safe_load](https://www.rubydoc.info/stdlib/psych/Psych.safe_lo
375375LabTech requires permitting the following classes using
376376[ config.active_record.yaml_column_permitted_classes] ( https://guides.rubyonrails.org/configuring.html#config-active-record-yaml-column-permitted-classes ) :
377377
378- - ` Symbol `
379- - ` Time `
378+ - ` ActiveSupport::Duration `
380379- ` ActiveSupport::TimeWithZone `
381380- ` ActiveSupport::TimeZone `
381+ - ` Symbol `
382+ - ` Time `
383+
384+ * Note: this list is almost certainly incomplete!*
385+
386+ If you discover new ones, please submit an issue or PR. (There's also a list
387+ in ./lib/lab_tech/engine.rb that should be considered canonical.)
382388
383389## Contributing
384390
Original file line number Diff line number Diff line change @@ -4,18 +4,29 @@ class Engine < ::Rails::Engine
44 config . generators . api_only = true
55
66 config . after_initialize do
7+ # NOTE: this list also exists in the README; please try to keep them in sync.
78 required_serializable_classes = [
89 ActiveSupport ::Duration ,
910 ActiveSupport ::TimeWithZone ,
1011 ActiveSupport ::TimeZone ,
11- Time ,
12+ Symbol ,
13+ Time ,
1214 ]
13-
15+
1416 missing_classes = required_serializable_classes - Rails . configuration . active_record . yaml_column_permitted_classes
1517
1618 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+ puts <<~EOF . red
20+
21+ Please add the following classes to your
22+ Rails.configuration.active_record.yaml_column_permitted_classes:
23+ #{ missing_classes . map { |klass | " - #{ klass } " } . join ( '\n' ) }
24+
25+ Because LabTech uses ActiveRecord's `serialize` to save experimental
26+ results to the database, running experiments is likely to break your
27+ application horribly without this configuration.
28+
29+ EOF
1930 end
2031 end
2132 end
You can’t perform that action at this time.
0 commit comments