diff --git a/lib/lifeform/form.rb b/lib/lifeform/form.rb index c0d0b9f..0ecca95 100644 --- a/lib/lifeform/form.rb +++ b/lib/lifeform/form.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require "hash_with_dot_access" +require "sequel/model/default_inflections" +require "sequel/model/inflections" module Lifeform FieldDefinition = Struct.new(:type, :library, :parameters) diff --git a/lib/lifeform/helpers.rb b/lib/lifeform/helpers.rb index b042b63..32cacdf 100644 --- a/lib/lifeform/helpers.rb +++ b/lib/lifeform/helpers.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require "sequel/model/default_inflections" -require "sequel/model/inflections" - module Lifeform module Helpers # Below is pretty much verbatim copied over from Bridgetown @@ -79,7 +76,7 @@ def encode(...) def text(callback) (callback.is_a?(Proc) ? html(callback) : callback).to_s.then do |str| - next str if str.respond_to?(:html_safe) && str.html_safe? + next str if str.html_safe? str.encode(xml: :attr).gsub(%r{\A"|"\Z}, "") end