Sha256: 10698f94add75dd6ce75bb027eb89197937a8dac4f152b5fac7a9db786e9207e

Contents?: true

Size: 477 Bytes

Versions: 7

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

require_relative "../exceptions_base"

module Exceptions
  module ActiveRecord
    class Base < ExceptionsBase
      private

      def corrected_cmd
        @corrected_cmd ||= last_cmd.gsub(/\b#{unknown_from_exception}\b/, corrected_word)
      end

      def unknown_from_exception
        exception.to_s.match(exception_regexp)[1]
      end

      def dictionary
        store.transaction { |s| s["associations"] }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pry-byetypo-1.3.5 lib/pry-byetypo/exceptions/active_record/base.rb
pry-byetypo-1.3.4 lib/pry-byetypo/exceptions/active_record/base.rb
pry-byetypo-1.3.3 lib/pry-byetypo/exceptions/active_record/base.rb
pry-byetypo-1.3.2 lib/pry-byetypo/exceptions/active_record/base.rb
pry-byetypo-1.3.1 lib/pry-byetypo/exceptions/active_record/base.rb
pry-byetypo-1.3.0 lib/pry-byetypo/exceptions/active_record/base.rb
pry-byetypo-1.2.0 lib/pry-byetypo/exceptions/active_record/base.rb