Sha256: 70d1b375f8c66883db24c5358cadb0f0454971cdd69f6dfa1b1ab14f4ece93bb

Contents?: true

Size: 434 Bytes

Versions: 2

Compression:

Stored size: 434 Bytes

Contents

class Juliett < ApplicationRecord
  belongs_to :alfa

  validate :custom_alfa_validation
  validate :custom_string_validation
  validate :custom_integer_validation

  private

  def custom_alfa_validation
    errors.add(:alfa, 'should be specific')
  end

  def custom_string_validation
    errors.add(:a_string, 'should be specific')
  end

  def custom_integer_validation
    errors.add(:an_integer, 'should be specific')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dirty_seed-0.2.1 spec/dummy/app/models/juliett.rb
dirty_seed-0.2.0 spec/dummy/app/models/juliett.rb