instance method format_for_inspect

Ruby on Rails 6.0.6

Since v6.0.6 Private

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

format_for_inspect(value)

No documentation comment.

Parameters

value req
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 402
      def format_for_inspect(value)
        if value.is_a?(String) && value.length > 50
          "#{value[0, 50]}...".inspect
        elsif value.is_a?(Date) || value.is_a?(Time)
          %("#{value.to_s(:db)}")
        else
          value.inspect
        end
      end

Defined in activerecord/lib/active_record/attribute_methods.rb line 402 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::AttributeMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close