Sha256: 264292c25acb86992d8f469fd79ad3484c143f37e1d8b3c98721abaae1e5b700

Contents?: true

Size: 371 Bytes

Versions: 14

Compression:

Stored size: 371 Bytes

Contents

require 'active_support/core_ext/string/output_safety'
module HoboFields
  module Types
    class Text < String

      COLUMN_TYPE = :text unless defined? COLUMN_TYPE

      def to_html(xmldoctype = true)
        ERB::Util.html_escape(self).gsub("\n", "<br#{xmldoctype ? ' /' : ''}>\n").html_safe
      end

      HoboFields.register_type(:text, self)

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hobo_fields-2.2.6 lib/hobo_fields/types/text.rb
hobo_fields-2.2.5 lib/hobo_fields/types/text.rb
hobo_fields-2.2.4 lib/hobo_fields/types/text.rb
hobo_fields-2.2.3 lib/hobo_fields/types/text.rb
hobo_fields-2.2.2 lib/hobo_fields/types/text.rb
hobo_fields-2.2.1 lib/hobo_fields/types/text.rb
hobo_fields-2.2.0 lib/hobo_fields/types/text.rb
hobo_fields-2.1.2 lib/hobo_fields/types/text.rb
hobo_fields-2.1.1 lib/hobo_fields/types/text.rb
hobo_fields-2.1.0 lib/hobo_fields/types/text.rb
hobo_fields-2.1.0.pre4 lib/hobo_fields/types/text.rb
hobo_fields-2.1.0.pre3 lib/hobo_fields/types/text.rb
hobo_fields-2.1.0.pre2 lib/hobo_fields/types/text.rb
hobo_fields-2.1.0.pre1 lib/hobo_fields/types/text.rb