Automatic patch loading
DRG CMS also has its own system for loading patches in development. First create load_patches.rb file in the config/initializers directory. File will be automatically loaded by Rails when started. File must include this two lines.
require 'patches/some_ruby_file.rb'
DrgCms::add_patches_path(File.expand_path("../../../lib/patches", __FILE__))
DrgCms::add_patches_path(File.expand_path("../../../lib/patches", __FILE__))
First line will force loading some_ruby_file.rb when Rails project is initialized. Second line will add lib/patches directory to DRG CMS internal patches path variable, which holds paths to all internal patches. This will help automatically reload patches on updates in development.
Field type my_field can from now on be used on forms together with other fields.
Last update: 08.05.2018