Sha256: e3d479176f0c729b2557c99f561d0fb0b87bffa8cb0c5bbbc97db531a9e9dd50

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 Bytes

Contents

class Alfa < ApplicationRecord
  has_one :delta
  has_many :echos, as: :echoable
  has_many :julietts

  after_initialize do |alfa|
    raise StandardError, dirty_message('initialize') if alfa.a_string == '39763e57-f8a0-483a-8b26-cc670de8cbfd'
  end

  before_save do |alfa|
    raise StandardError, dirty_message('save') if alfa.a_string == '5ecb793c-e0fd-4315-b60d-66f34c1c17e3'
  end

  def dirty_message(action)
    <<~DIRTY
      a dirty message on #{action}
      taking several
      lines and with a lot of
      characters
      #{Faker::Lorem.paragraph_by_chars(number: 500, supplemental: false)}
    DIRTY
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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