Sha256: db953ffc99c840489527e651ea725e454503de52d55a3b8c36710315adf32987

Contents?: true

Size: 290 Bytes

Versions: 2

Compression:

Stored size: 290 Bytes

Contents

# frozen_string_literal: true

# ported from rspec-rails
# There is no reason to install whole gem as we
# need only that tiny helper
class ::ActiveRecord::Base

  def error_on(attribute)
    self.valid?
    [self.errors[attribute]].flatten.compact
  end

  alias :errors_on :error_on

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
schema_validations-2.4.1 spec/support/active_model.rb
schema_validations-2.4.0 spec/support/active_model.rb