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
administrate-1.0.0.beta3 lib/administrate/field/text.rb
administrate-1.0.0.beta2 lib/administrate/field/text.rb
administrate-1.0.0.beta1 lib/administrate/field/text.rb
administrate-0.20.1 lib/administrate/field/text.rb
administrate-0.20.0 lib/administrate/field/text.rb
administrate-0.19.0 lib/administrate/field/text.rb
administrate-0.18.0 lib/administrate/field/text.rb
administrate-0.17.0 lib/administrate/field/text.rb
administrate-0.16.0 lib/administrate/field/text.rb
administrate-0.15.0 lib/administrate/field/text.rb
administrate-0.14.0 lib/administrate/field/text.rb
viniBaxterDesk-22.0.0 lib/administrate/field/text.rb
viniBaxterDesk-0.21.0 lib/administrate/field/text.rb
viniBaxterDesk-0.20.0 lib/administrate/field/text.rb
viniBaxterDesk-0.14.0 lib/administrate/field/text.rb
viniBaxterDesk-0.13.2 lib/administrate/field/text.rb
viniBaxterDesk-0.13.1 lib/administrate/field/text.rb
administrate-0.13.0 lib/administrate/field/text.rb
administrate-0.12.0 lib/administrate/field/text.rb
administrate-0.11.0 lib/administrate/field/text.rb