lib/dry_crud/engine.rb in dry_crud-3.0.0 vs lib/dry_crud/engine.rb in dry_crud-5.0.0

- old
+ new

@@ -1,18 +1,16 @@ module DryCrud class Engine < Rails::Engine - - - initializer "dry_crud.field_error_proc" do |app| + initializer 'dry_crud.field_error_proc' do |_app| # Fields with errors are directly styled in DryCrud::FormBuilder. # Rails should just output the plain html tag. - ActionView::Base.field_error_proc = proc { |html_tag, instance| html_tag } - + ActionView::Base.field_error_proc = proc { |html_tag, _instance| html_tag } + # Load dry_crud engine helpers first so that the application may override them. paths = ApplicationController.helpers_path - if dry_crud_helpers = paths.detect {|p| p =~ /dry_crud(-\d+\.\d+\.\d+)?#{File::SEPARATOR}app#{File::SEPARATOR}helpers\z/ } + if dry_crud_helpers = paths.detect { |p| p =~ /dry_crud(-\d+\.\d+\.\d+)?#{File::SEPARATOR}app#{File::SEPARATOR}helpers\z/ } paths.delete(dry_crud_helpers) paths.prepend(dry_crud_helpers) end end end -end \ No newline at end of file +end