class TileTooManyTilesValidator < ActiveModel::Validator
  def validate(record)
    if Tile.count >= 99 && !record.persisted?
      record.errors.add :tiles, I18n.t('tile.too_many_tiles')
    end
  end
end
