Sha256: c60c23b6e33a6c552dc54dda7d68393afe861f75b9674588dcad500f3e029cdd

Contents?: true

Size: 334 Bytes

Versions: 43

Compression:

Stored size: 334 Bytes

Contents

require_relative "base"

module Administrate
  module Field
    class Text < Administrate::Field::Base
      def self.searchable?
        false
      end

      def truncate
        data.to_s[0...truncation_length]
      end

      private

      def truncation_length
        options.fetch(:truncate, 50)
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 3 rubygems

Version Path
semantic-administrate-0.10.1 lib/administrate/field/text.rb
semantic-administrate-0.10.0 lib/administrate/field/text.rb
administrate-0.10.0 lib/administrate/field/text.rb
semantic-administrate-0.1.1 lib/administrate/field/text.rb
administrate-0.9.0 lib/administrate/field/text.rb
semantic-administrate-0.1.0 lib/administrate/field/text.rb
administrate-0.8.1 lib/administrate/field/text.rb
administrate-0.8.0 lib/administrate/field/text.rb
administrate-0.7.0 lib/administrate/field/text.rb
administrate-0.6.0 lib/administrate/field/text.rb
administrate-0.5.0 lib/administrate/field/text.rb
administrate-0.4.0 lib/administrate/field/text.rb
administrate-0.3.0 lib/administrate/field/text.rb
administrate-0.2.2 lib/administrate/field/text.rb
administrate-0.2.1 lib/administrate/field/text.rb
administrate-0.2.0 lib/administrate/field/text.rb
administrate-0.2.0.rc1 lib/administrate/field/text.rb
administrate-0.1.5 lib/administrate/field/text.rb
administrate-0.1.4 lib/administrate/field/text.rb
administrate-0.1.3 lib/administrate/fields/text.rb