lib/ckeditor/engine.rb in ckeditor-3.7.0.rc3 vs lib/ckeditor/engine.rb in ckeditor-3.7.0

- old
+ new

@@ -22,15 +22,16 @@ ActionView::Helpers::FormBuilder.send :include, Ckeditor::Helpers::FormBuilder end end initializer "ckeditor.hooks" do - if Object.const_defined?("Formtastic") + # Don't load the hook for Formtastic < 2.0.0 that (it crashes), apparently, didn't define a Formtastic::Inputs. + if Object.const_defined?("Formtastic") && Formtastic.const_defined?("Inputs") require "ckeditor/hooks/formtastic" end if Object.const_defined?("SimpleForm") - ::SimpleForm::FormBuilder.send :include, Ckeditor::Hooks::SimpleFormBuilder + require "ckeditor/hooks/simple_form" end end end end