Sha256: 1465bb37a5b96b4bfe1ef084f616f7e76ee96bcffdb11e9f714e5702320e89f5

Contents?: true

Size: 639 Bytes

Versions: 5

Compression:

Stored size: 639 Bytes

Contents

module ForeignKeyValidation
  module Errors

    class NoReleationFoundError < StandardError
      def initialize(name)
        super("Can't find any belongs_to relations for #{name} class. Put validation call below association definitions!")
      end
    end

    class NoForeignKeyFoundError < StandardError
      def initialize(validate_against, table_name)
        super("No foreign key for relation #{validate_against} on #{table_name} table!")
      end
    end

    class UnknownRelationError < StandardError
      def initialize(validate_with)
        super("Unknown relation in #{validate_with}!")
      end
    end

  end
end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreign_key_validation-1.1.2 lib/foreign_key_validation/errors.rb
foreign_key_validation-1.1.1 lib/foreign_key_validation/errors.rb
foreign_key_validation-1.1.0 lib/foreign_key_validation/errors.rb
foreign_key_validation-1.0.1 lib/foreign_key_validation/errors.rb
foreign_key_validation-1.0.0 lib/foreign_key_validation/errors.rb