Sha256: e56fd79075907a1cc4dfcacb74c30410256054a6673dd49fffc40a2fcc4eb18c

Contents?: true

Size: 463 Bytes

Versions: 2

Compression:

Stored size: 463 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 some specific alfa')
  end

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dirty_seed-0.1.8 spec/dummy/app/models/juliett.rb
dirty_seed-0.1.7 spec/dummy/app/models/juliett.rb